You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by 白 可 <cp...@hotmail.com> on 2004/08/09 09:05:14 UTC

How to use org.apache.poi.hdf.extractor.WordDocument correctly

Hi, everyone.

In my project, I need to deal with the tables in the word documents.
But I got some problems during the using of the WordDocument class.
for example, this is my simple source code.(Maybe it is wrong)

import java.io.*;
import org.apache.poi.hdf.extractor.WordDocument;

public class TestHDFDocument {
  public TestHDFDocument() {
  }

  public static void main(String[] args) {
    try
      {
          String outName = "C:\\test.xml";
          InputStream is = new FileInputStream ("C:\\hello.doc");
          WordDocument file = new WordDocument(is);
          file.openDoc();
          file.closeDoc();
      }
      catch(Exception e)
      {
          e.printStackTrace();
      }
      System.exit(0);

  }
}

when I run this code,there are a lot of errors below:
java.lang.NullPointerException

	at java.io.FileOutputStream.open(Native Method)

	at java.io.FileOutputStream.<init>(FileOutputStream.java:176)

	at java.io.FileOutputStream.<init>(FileOutputStream.java:70)

	at 
org.apache.poi.hdf.extractor.WordDocument.closeDoc(WordDocument.java:1501)

	at 
org.apache.poi.hdf.WordDocument.TestHDFDocument.main(TestHDFDocument.java:15)



my problem is how to use this class correctly.

thanks and regards

baike

_________________________________________________________________
免费下载 MSN Explorer:   http://explorer.msn.com/lccn/  


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: How to use org.apache.poi.hdf.extractor.WordDocument correctly

Posted by "Koundinya (Sudhakar Chavali)" <su...@yahoo.com>.
hi all,

I suggest you to use Text Mining API which is developed using POI
source: www.textmining.org

Thera allmost all problems have been solved

Best Regards
Sudhajar

--- �� �� <cp...@hotmail.com> wrote:

> Hi, everyone.
> 
> In my project, I need to deal with the tables in the word documents.
> But I got some problems during the using of the WordDocument class.
> for example, this is my simple source code.(Maybe it is wrong)
> 
> import java.io.*;
> import org.apache.poi.hdf.extractor.WordDocument;
> 
> public class TestHDFDocument {
>   public TestHDFDocument() {
>   }
> 
>   public static void main(String[] args) {
>     try
>       {
>           String outName = "C:\\test.xml";
>           InputStream is = new FileInputStream ("C:\\hello.doc");
>           WordDocument file = new WordDocument(is);
>           file.openDoc();
>           file.closeDoc();
>       }
>       catch(Exception e)
>       {
>           e.printStackTrace();
>       }
>       System.exit(0);
> 
>   }
> }
> 
> when I run this code,there are a lot of errors below:
> java.lang.NullPointerException
> 
> 	at java.io.FileOutputStream.open(Native Method)
> 
> 	at java.io.FileOutputStream.<init>(FileOutputStream.java:176)
> 
> 	at java.io.FileOutputStream.<init>(FileOutputStream.java:70)
> 
> 	at 
> org.apache.poi.hdf.extractor.WordDocument.closeDoc(WordDocument.java:1501)
> 
> 	at 
> org.apache.poi.hdf.WordDocument.TestHDFDocument.main(TestHDFDocument.java:15)
> 
> 
> 
> my problem is how to use this class correctly.
> 
> thanks and regards
> 
> baike
> 
> _________________________________________________________________
> ������� MSN Explorer:   http://explorer.msn.com/lccn/  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 
> 


=====
"No one can earn a million dollars honestly."- William Jennings Bryan (1860-1925) 

"Make everything as simple as possible, but not simpler."- Albert Einstein (1879-1955)

"It is dangerous to be sincere unless you are also stupid."- George Bernard Shaw (1856-1950)


		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: How to use org.apache.poi.hdf.extractor.WordDocument correctly

Posted by "Koundinya (Sudhakar Chavali)" <su...@yahoo.com>.
Check this link
http://www.mail-archive.com/poi-user@jakarta.apache.org/msg03883.html


--- �� �� <cp...@hotmail.com> wrote:

> Hi, everyone.
> 
> In my project, I need to deal with the tables in the word documents.
> But I got some problems during the using of the WordDocument class.
> for example, this is my simple source code.(Maybe it is wrong)
> 
> import java.io.*;
> import org.apache.poi.hdf.extractor.WordDocument;
> 
> public class TestHDFDocument {
>   public TestHDFDocument() {
>   }
> 
>   public static void main(String[] args) {
>     try
>       {
>           String outName = "C:\\test.xml";
>           InputStream is = new FileInputStream ("C:\\hello.doc");
>           WordDocument file = new WordDocument(is);
>           file.openDoc();
>           file.closeDoc();
>       }
>       catch(Exception e)
>       {
>           e.printStackTrace();
>       }
>       System.exit(0);
> 
>   }
> }
> 
> when I run this code,there are a lot of errors below:
> java.lang.NullPointerException
> 
> 	at java.io.FileOutputStream.open(Native Method)
> 
> 	at java.io.FileOutputStream.<init>(FileOutputStream.java:176)
> 
> 	at java.io.FileOutputStream.<init>(FileOutputStream.java:70)
> 
> 	at 
> org.apache.poi.hdf.extractor.WordDocument.closeDoc(WordDocument.java:1501)
> 
> 	at 
> org.apache.poi.hdf.WordDocument.TestHDFDocument.main(TestHDFDocument.java:15)
> 
> 
> 
> my problem is how to use this class correctly.
> 
> thanks and regards
> 
> baike
> 
> _________________________________________________________________
> ������� MSN Explorer:   http://explorer.msn.com/lccn/  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 
> 


=====
"No one can earn a million dollars honestly."- William Jennings Bryan (1860-1925) 

"Make everything as simple as possible, but not simpler."- Albert Einstein (1879-1955)

"It is dangerous to be sincere unless you are also stupid."- George Bernard Shaw (1856-1950)


		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org