outlook mail item to MAPI store item

O

Omar

Hi,

In OutlookSpy, i'm able to look at MailItem properties or IMessage
properties. I know the MailItem has an entryID... is this what is used
to get the message from the store so you can look at the IMessage? I
assume we also need to know the store the msg is in. Can all this
information be deduced from the MailItem itself, or do we need to use
some context information that has been gathered beforehand. For
instance, I know my mail is in folder F, which is in store S, so i
know where to use the EntryID. What's the best way to do this
programmatically?

omar
 
K

Ken Slovak - [MVP - Outlook]

Every Outlook item has an EntryID and Item.Parent is the folder it's
in. Item.Parent.StoreID returns the InfoStore's identifier. When I
want to equate an Outlook MailItem to a CDO Message item for example I
get the Message this way (you'd need a reference to CDO 1.21 for
this):

strEntryID = objMailItem.EntryID
strStoreID = objMailItem.Parent.StoreID
Set objCDO = CreateObject("MAPI.Session")
objCDO.Logon "", "", False, False 'login using piggy back on current
Outlook session
Set objCDOMessage = objCDO.GetMessage(strEntryID, strStoreID)

For working with pure Extended MAPI you'd have to code in C++ or
Delphi, VB can't work with Extended MAPI. A COM wrapper for some
Extended MAPI things is Redemption (www.dimastr.com/redemption).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top