wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes org.apache.poi.poifs.filesystem.OfficeXmlFileException while reading .docx file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "org.apache.poi.poifs.filesystem.OfficeXmlFileException while reading .docx file" Watch "org.apache.poi.poifs.filesystem.OfficeXmlFileException while reading .docx file" New topic

org.apache.poi.poifs.filesystem.OfficeXmlFileException while reading .docx file

manu chandra

Joined: Oct 08, 2012
Posts: 15
Hi ,

I am trying to read a .docx format file . But i am getting an error like :

org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. POI only supports OLE2 Office documents

But it suggest to use xssf instead of hssf but my doubt is xssf is used for reading excel files..
I am not reading any excel here but i want to read .docx and .doc files..

Can any one please help?
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41068
I don't know what the "it" is that recommends to use XSSF, but the API to use for reading .docx is XWPF, whereas for .doc it is HWPF. I don't think there is a combined API that can read both formats (like there is the SS API that combines HSSF and XSSF).

Ping & DNS - my free Android networking tools app
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: org.apache.poi.poifs.filesystem.OfficeXmlFileException while reading .docx file
Similar Threads
error reading excel file using apache poi
How to read .xlsx sheet from Client Side using poi 3.5
Read a .xls,.xlsx file format using XSSF
How to identify the Microsoft office version + POI