org.apache.poi.poifs.filesystem.OfficeXmlFileException while reading .docx file
manu chandra
Greenhorn
Joined: Oct 08, 2012
Posts: 15
posted
0
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
Marshal
Joined: Mar 22, 2005
Posts: 35246
7
posted
0
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).