Uniquely Identifies MailItem

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

Uniquely Identifies MailItem
 
Sergey Grischenko


Add-in Express team


Posts: 7230
Joined: 2004-07-05
Rup,
I haven't tested the code and I can't give the answer right now. Are you able to test it yourself?
You can also use Extended MAPI to add the X-header. However I think the CDO object model is more simple way.
Posted 20 Apr, 2007 09:33:55 Top
Rup Go




Posts: 64
Joined: 2007-03-01
Hi Sergey,

havn't tried it yet coz i need to rewrite it first in C#, hmm but i think using what we have is better "extended MAPI" than using the CDO. Either way il try to make this work, but do you have a sample using extended MAPI?

thanks a lot!
Posted 20 Apr, 2007 11:35:21 Top
Sergey Grischenko


Add-in Express team


Posts: 7230
Joined: 2004-07-05
Rup, please try the following example:
http://www.add-in-express.com/projects/olxheaderexample.zip
Posted 20 Apr, 2007 12:11:18 Top
Rup Go




Posts: 64
Joined: 2007-03-01
hmm, got it..but the header always changes when user replied back so theirs no way to keep the inserted text.

Posted 22 Apr, 2007 23:43:36 Top
Rup Go




Posts: 64
Joined: 2007-03-01
Pierre-D. Savard!

can someone elaborate on this? thanks! ^_^

Posted 22 Apr, 2007 23:55:20 Top
Rup Go




Posts: 64
Joined: 2007-03-01
You can use user property of the mail item to save a GUID in it:

GUID = System.Guid.NewGuid.ToString("B").ToUpper
prop = newMail.UserProperties.Add("crmid", Outlook.OlUserPropertyType.olText)
prop.Value = GUID
newMail.Save()

can someone elaborate on this?
Posted 22 Apr, 2007 23:57:11 Top
Rup Go




Posts: 64
Joined: 2007-03-01
follow up question:

where can i insert my text here? and how can i retreive this.? thanks pls elaborate
Posted 23 Apr, 2007 00:04:16 Top
Rup Go




Posts: 64
Joined: 2007-03-01
i tried this

Insert

Outlook.MailItem mailObject = null;
Outlook.Explorer explorer = OutlookApp.ActiveExplorer();
mailObject = explorer.Selection[1] as Outlook.MailItem;

String GUID = System.Guid.NewGuid().ToString("B").ToUpper();
Outlook.UserProperty prop = mailObject.UserProperties.Add("inserted",Outlook.OlUserPropertyType.olText,null,null);
prop.Value = GUID;
mailObject.Save();

Retrieve

Outlook.MailItem mailObject = null;
Outlook.Explorer explorer = OutlookApp.ActiveExplorer();
mailObject = explorer.Selection[1] as Outlook.MailItem;
Outlook.UserProperty prop = mailObject.UserProperties.Find("inserted", Outlook.OlUserPropertyType.olText);

MessageBox.Show(prop.Value.ToString());

i assume what im inserting in the user properties "inserted" is the letter B, but im not really sure. When i retrieved the user prop value it just gave me a set of hex 89B0 watsoever, help please. Thanks.
Posted 23 Apr, 2007 00:20:22 Top
Sergey Grischenko


Add-in Express team


Posts: 7230
Joined: 2004-07-05
Hi Rup.

As far as I see in the code you insert the GUID value. I would use a permanent guid to mark my emails.
Posted 23 Apr, 2007 08:28:37 Top
Rup Go




Posts: 64
Joined: 2007-03-01
Hi Sergey,

can you elaborate on how to insert a permanent guid?

thanks ^^
Posted 23 Apr, 2007 21:42:29 Top