GKoehn
Guest
|
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. |
|
Dmitry Kostochko
Add-in Express team
Posts: 2875
Joined: 2004-04-05
|
|
GKoehn
Guest
|
Here is the code I use in a Delphi App using RapWare EasyMAPI.
procedure TUIMain.btnGetGuidsClick(Sender: TObject);
var
MsgStore: IRwMapiMsgStore;
Folder: IRwMapiFolder;
ContentTable: IRwMapiTable;
Restriction: IRwMapiRestrictionExists;
GuidFromEmail: string;
AEntryID: TRwMapiEntryID;
Msg: IRwMapiMessage;
begin
MsgStore := MapiSession.OpenDefaultMsgStore;
Folder := MsgStore.OpenFolderByType(ftSentItems);
ContentTable := Folder.GetContentsTable;
ContentTable.Fields.Add(PR_ENTRYID);
ContentTable.Fields.Add(PR_LAST_MODIFICATION_TIME);
ContentTable.Fields.Add(NPR_MYGUID);
ContentTable.Open;
Restriction := ContentTable.CreateRestriction(rtExists) as IRwMapiRestrictionExists;
Restriction.PropDef := NPR_MYGUID;
ContentTable.Filter(Restriction);
ContentTable.First;
while not ContentTable.EOF do
begin
GuidFromEmail := ContentTable.FieldByName(PR_ENTRYID).Value;
AEntryID := ContentTable.FieldByName(PR_ENTRYID).Value;
GuidFromEmail := ContentTable.FieldByName(NPR_MYGUID).Value;
Showmessage(GuidFromEmail);
ContentTable.Next;
end;
ContentTable.Close;
end;
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. |
|
Dmitry Kostochko
Add-in Express team
Posts: 2875
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. |
|