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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to