Relaxx
Relaxx

Reputation: 1

Outlook.MailItem custom properties issue

i have the following situation for my Add-In (Office >= 2010):

I want to add some custom properties to an Outlook.MailItem (property must be mail associated) while the mailtext is written. If this mail is sent i want to grap the send event and get the previously set properties again, doing something and removing the properties and continue sending.

Problem if i use PropertyAccessor: I use it as follows to save the property while writing the mail:

string propTag = "http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/test_property"
mailItem.PropertyAccessor.SetProperty(propTag, value);

And to read the property again on sending the mail:

string propTag = "http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/test_property"
string readProperty = mailItem.PropertyAccessor.GetProperty(propTag);

OutlookSpy (http://www.dimastr.com/outspy/home.htm) can find the property on sending so does anyone knows how to read the properties in a different way?

I would thank you very much for every help.

Upvotes: 0

Views: 932

Answers (1)

Eugene Astafiev
Eugene Astafiev

Reputation: 49395

You need to call Save if you want your changes to be persisted.

Upvotes: 1

Related Questions