There is a way but I don't know how to do it with the old stuff. I am working on new stuff right now. You need to get the short at offset 0xA of the FIB. Check for the bit flag 0x0100. If this doesn't make sense to you, you will have to wait for the new stuff I guess.
-Ryan ----- Original Message ----- From: "Nick Burch" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 10, 2004 11:58 AM Subject: Password protected word documents > I'm using POI to extract text from word and excel documents. For word > documents, I'm using org.apache.poi.hdf.extractor.WordDocument. > > The problem comes if I try to open a password protected word document - it > breaks POI with an out of memory error > > Exception in thread "main" java.lang.OutOfMemoryError: > at org.apache.poi.hdf.extractor.WordDocument.initDocProperties(WordDocument.jav a:575) > at org.apache.poi.hdf.extractor.WordDocument.processComplexFile(WordDocument.ja va:329) > at org.apache.poi.hdf.extractor.WordDocument.readFIB(WordDocument.java:287) > at org.apache.poi.hdf.extractor.WordDocument.<init>(WordDocument.java(Compiled > Code)) > > I don't want to extract text from these, but I would like to be able to > detect them so I can skip them. Is there a way to discover if a Word > document is protected? > > Thanks > Nick > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
