Closed GoogleCodeExporter closed 9 years ago
okay, I've addressed this in SVN for the library, but not rolled it out to
pst2gmail as it will take a little more work.
Basically, instead of the attached email being a real attachment, it is an
embedded one. Previously it was thought that only calendar items were attached
this way, but it makes sense that other outlook objects would follow the same
pattern.
I've changed the API some to accommodate this, you can use code like the
following to get at your attached email:
PSTFile pstFile = new PSTFile("test.pst");
PSTMessage message = (PSTMessage)PSTObject.detectAndLoadPSTObject(pstFile,
2097188); //2097188 being the id of your message
PSTAttachment attachment = message.getAttachment(0);
if (attachment.getAttachMethod() == PSTAttachment.ATTACHMENT_METHOD_EMBEDDED) {
PSTMessage attachedMessage = attachment.getEmbeddedPSTMessage();
System.out.println(attachedMessage.getBody());
}
Original comment by rjohnson...@gmail.com
on 23 Jul 2010 at 10:54
Thanks for the fix!
Could you help me how to find "descriptorIndex" value for each object (i.e:
PSTObject, PSTMessage, PSTTask, PSTFoder) ?
For the code above:
(PSTMessage)PSTObject.detectAndLoadPSTObject(pstFile, 2097188); //2097188 being
the id of your message.
As I understand, I could get DescriptorIndexNode value for each item and use
following method:
static PSTObject detectAndLoadPSTObject(PSTFile theFile, DescriptorIndexNode
folderIndexNode)
But it's big value to store in DB (32 bytes mean 64 chars in hex). A long value
is preferable.
Regards,
Maxim
Original comment by justpdat...@gmail.com
on 26 Jul 2010 at 1:29
just off the top of my head as don't have time to check it properly atm, you
should be able to do:
long PSTObject.getDescriptorNode().descriptorIdentifier
PSTObject.detectAndLoadPSTObject can also take a long as an argument.
Note that these are really internal indexes used by the PST and probably
wouldn't be that useful for anything else. I don't even know if they are
guaranteed to stay the same over time! :/ Probably something in the MS docs
about that.
Original comment by rjohnson...@gmail.com
on 26 Jul 2010 at 1:47
Original issue reported on code.google.com by
justpdat...@gmail.com
on 13 Jul 2010 at 12:41Attachments: