Reading MI.UserProperties from EasyMAPI

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

Reading MI.UserProperties from EasyMAPI

Posts: 39
Joined: 2009-03-23
I am trying to mix EasyMAPI with Add-in Express. In my Add-in for Outlook I am adding a User Property to a email.
MI.UserProperties.Add('MyGUID', olText, False, olText);

Can someone help me to read this through EasyMAPI in the same Add-in?

Maybe someone has a better plan!

I need to quickly search the sent folder for this item after a certain time frame has elapsed. This user property contains a GUID string.

I want to find this item in the Sent Folder and read it's EntryID.

I have done this in an external app that did not use Add-in Express by using EasyMAPI's CreateRestriction function. This works fine, however now I need to do it in an Add-in.
Posted 11 May, 2011 19:33:41 Top
Dmitry Kostochko

Add-in Express team

Posts: 2839
Joined: 2004-04-05
Hi Gregory,

Sorry but I am a bit confused since I cannot find any CreateRestriction method or function in the RapWare Easy MAPI library. Do you mean this component set or Extended MAPI CreateRestriction function?

BTW, you can search through a list of Outlook items by using the Outlook Object Model features. Please have a look at the Find/FindNext and Restrict methods of the Items collection:
Items.Find method
Items.FindNext method
Items.Restrict method
Posted 12 May, 2011 07:34:01 Top

Posts: 39
Joined: 2009-03-23
Here is the code I use in a Delphi App using RapWare EasyMAPI.

procedure TUIMain.btnGetGuidsClick(Sender: TObject);
  MsgStore: IRwMapiMsgStore;
  Folder: IRwMapiFolder;
  ContentTable: IRwMapiTable;
  Restriction: IRwMapiRestrictionExists;
  GuidFromEmail: string;
  AEntryID: TRwMapiEntryID;
  Msg: IRwMapiMessage;
  MsgStore := MapiSession.OpenDefaultMsgStore;
  Folder := MsgStore.OpenFolderByType(ftSentItems);

  ContentTable := Folder.GetContentsTable;
  Restriction := ContentTable.CreateRestriction(rtExists) as IRwMapiRestrictionExists;
  Restriction.PropDef := NPR_MYGUID;
  while not ContentTable.EOF do
      GuidFromEmail := ContentTable.FieldByName(PR_ENTRYID).Value;
      AEntryID := ContentTable.FieldByName(PR_ENTRYID).Value;
      GuidFromEmail := ContentTable.FieldByName(NPR_MYGUID).Value;

In my Com Add-in I use MI.UserProperties.Add('MyGUID', olText, False, olText).
I need to use the ContentTable.CreateRestriction above on this property.
How do I modify the above code for that?

I have a unique situation.
Firm is using Outlook 2003 against Exchange 2010.

I have a hook in the Sent folder and it has always worked except at this Firm.
I have found the adxOutlookAppEvents1ItemSend event still fires although it fires too soon.
The item is still in the outbox.
I need to get notified when it is in the sent folder.
This is what I am trying to work around.
Posted 12 May, 2011 11:43:33 Top
Dmitry Kostochko

Add-in Express team

Posts: 2839
Joined: 2004-04-05
Hi Gregory,

Sorry, I do not know the RapWare EasyMAPI code well enough to suggest you anything of value. Please try to use the Restrict method of the Outlook Object Model.
Posted 12 May, 2011 12:13:02 Top