outlook mail item to MAPI store item

  • Thread starter Thread starter Omar
  • Start date Start date
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
 
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).
 
Back
Top