Ho do I extract a Outlook message nested into another using Apache POI - HSMF?

Posted by Jan on Stack Overflow See other posts from Stack Overflow or by Jan
Published on 2012-11-25T05:00:38Z Indexed on 2012/11/25 5:03 UTC
Read the original article Hit count: 169

Filed under:
|
|

I am using Apache POI - HSMF to extract attachments from Outlooks msg-files. It works fine except for nested messages. If an msg is attached to another msg I am able to get the files. If a message is nested I get the information but I need the file.

MAPIMessage msg = new MAPIMessage(fileName)
for(AttachmentChunks attachment : msg.getAttachmentFiles()) {
    if(attachment.attachmentDirectory!=null){
        MAPIMessage nestedMsg attachment.attachmentDirectory.getAsEmbededMessage();
        // now save nestedMsg as a msg-file
    }
}

Is it possible to save the nested message file as a regular msg-file?

© Stack Overflow or respective owner

Related posts about java

Related posts about outlook