I am writing an Outlook Addin using VC / ATL. This particular addin receives the selected email messages and writes them to disk. It also writes all its attachments to disk. Then we read everything in our application outside of Outlook.
Using the Outlook object model, this is fairly simple, because both _MailItem and Attachment methods have SaveAs methods. The problem arises when the attachment is an embedded email, which we also want to split and save as separate files.
In an ideal world, I can request an attachment for the _MailItem interface and just treat it as a normal part of the selection. But QueryInterface returns "no interface".
I need a solution that works with Outlook XP (2002) through Outlook 2010. I know that in Outlook 2007 there is a method (CreateItemFromTemplate) for an application object that allows me to return MailItem from a saved message to disk, but this will not work for Outlook XP / 2003. I also need information about the sender / receiver.
I also know that a third-party Redemption library can do this using Extended MAPI. However, we try to avoid using third-party libraries.
Rohde source
share