Hello. I've downloaded the following:-
-poi 3.8 beta 3 from
http://www.bizdirusa.com/mirrors/apache//poi/dev/bin/poi-bin-3.8-beta3-20110606.zip
This zip contains several jar files. On the properties page of my project, I
clicked on libraries then clicked add jar and add all 6 jars that were in
the folder i extracted from this zip.
-poi-ooxml-3.8-beta3 which i found as link online

AT THIS POINT i got an exception CLASSDEFNOTFOUND xmlbeans. So i looked for
it for almost an hour and downloaded adn included it: xmlbeans-2.5.0.jar

AND STILL IT DIDNT WORK.

I did more reading. Found this jar file, downloaded and included it:
tika-app-0.6-jdk14.jar

STILL NO LUCK

All I want to do is to read the contents of a microsoft word document
version 2007.

This is my code. At least the relevant part. Please advise!!!

import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
..
FileInputStream fis1 = new FileInputStream(new File("C:\\documents and
settings\\omar\\desktop"));
XWPFDocument document1 = new XWPFDocument(fis1);
XWPFWordExtractor extractor1 = new XWPFWordExtractor(document1);
System.out.println(extractor1.getText());

When I run the code it stops at xwpfdocument document 1 = etcetcetc  I know
this because I added printlines before every one of these to find out where
it stopped working. i realized i didnt add any code to my catch block. I
fixed it. This is the exception i got: org.apache.poi.POIXMLException:
java.lang.reflect.InvocationTargetException

There's nothing wierd about my document. It's just a bunch of lines.

so whts the prb????

--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/can-t-read-contents-from-a-2007-ms-word-document-tp4504887p4504887.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