MAPI Store Accessor: Get MapiItem from IMessage?

Add-in Express™ Support Service
That's what is more important than anything else

MAPI Store Accessor: Get MapiItem from IMessage?
 
Jason Swager




Posts: 14
Joined: 2010-04-29
Is there a way to get a MapiItem class from an IMessage interface? I'm trying to use MAPI Store Access to read an attachment that is really a message that has attachments of its own, some of which could be yet another message (detect the recursion here? :) )

I can retrieve the first attached message as an IMessage, but can't get a MapiItem to be created from it.

I thought I could the IMapiProp interface of the IMessage to retrieve and EntryID, then create a MapiItem using that, but that works only if the message has an EntryID. Attached messages do not have an EntryID.
Posted 26 Oct, 2010 14:38:31 Top
Eugene Astafiev


Guest


Hi Jason,

Please try to save the attached e-mail first. Then you can try to get the PR_ENTRYID property. Does it work for you?
Posted 28 Oct, 2010 08:35:41 Top
Jason Swager




Posts: 14
Joined: 2010-04-29
Simply saving the attached email - using .Save() - doesn't seem to help. From what I've seen, an EntryID (and indirectly a StoreID) is only assigned after the message is placed in a folder. If the message exists in the file system, in memory, or is freshly created (not yet drafted or saved), then no EntryID exists.
Posted 01 Nov, 2010 10:26:59 Top
Eugene Astafiev


Guest


Hi Jason,

After saving a mail item (using the Save() method of MailItem class in Outlook) you will be able to get an instance of the AddinExpress.MAPI.MapiItem class using its entry id. Please let me know whether it works for you.
Posted 01 Nov, 2010 10:50:59 Top