I fixed it. Finally >.>
Hope this will help anyone in need.

[code]
package javaapplication9;   
  
import java.io.*;   
import java.util.logging.Level;   
import java.util.logging.Logger;   
import org.apache.poi.xwpf.usermodel.XWPFDocument;   
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;   
  
public class Main   
 {   
    public static void main(String[] args)   
     {   
        XWPFDocument doc;   
        try  
         {   
            doc = new XWPFDocument(new FileInputStream("C:\\documents and
settings\\x\\desktop\\1.docx"));   
            XWPFWordExtractor wordxExtractor = new XWPFWordExtractor(doc);   
            System.out.println(wordxExtractor.getText());   
         }   
  
        catch (IOException ex)   
         {   
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null,
ex);   
         }   
     }   
}  
[/code]

the list of jar files are the list of jar files you need to add when setting
the classpath are: 
dom4j-1.6.1.jar 
xmlbeans-2.3.0.jar 
poi-3.8-beta3-20110606.jar 
poi-ooxml-3.83-20110606.jar 
poi-ooxml-schemas-3.8-beta3-20110606.jar 

i got these jar files from
[url=http://www.apache.org/dyn/closer.cgi/poi/dev/src/poi-src-3.8-beta3-20110606.zip]http://www.apache.org/dyn/closer.cgi/poi/dev/src/poi-src-3.8-beta3-20110606.zip[/url]
just extract the contents to a folder

--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/can-t-read-contents-from-a-2007-ms-word-document-tp4504887p4505093.html
Sent from the POI - Dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to