I am using apache’s poi hsmf to process .msg outlook files.
When I try to retrieve date using MAPI’s getdate function it throws a ChunkNotFound Exception, I do not know what is going wrong.
Here is the code snippet
MAPIMessage msg = new MAPIMessage(“TestFolder/”+Filename);
String Result = msg.getSubject(); // works
Calendar CaObj = msg.getMessageDate(); ->Throws a ChunkNotFoundException here
Any Ideas?
The ChunkNotFoundException is being thrown because there’s no chunk in the file containing the message date
By default, MAPIMessage will thrown a ChunkNotFoundException when you ask for something that isn’t there. If you want, you can change that so it returns Null instead. Just call setReturnNullOnMissingChunk(true) on it first, then you’ll get nulls instead