i want to extract image and text from a
doc file. the code which i am trying works well.but now i want to extract image and text from docx file then this code throws an exception.
the code is-->
and the exception is-->
org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process this data (eg XSSF instead of HSSF)
at org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockReader.java:111)
at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:151)
at org.apache.poi.hwpf.HWPFDocument.verifyAndBuildPOIFS(HWPFDocument.java:119)
at org.apache.poi.hwpf.HWPFDocument.<init>(HWPFDocument.java:132)
at com.doylecentral.word.ReadDocFileFromJava.readMyDocument(ReadDocFileFromJava.java:33)
at com.doylecentral.word.ReadDocFileFromJava.main(ReadDocFileFromJava.java:24)
so please send me a sample code for docx file.since i am new to java so it is more difficult to make changes.
thanks in advance.