Hello,
I have an outlook add in project that sets custom properties to mails in the inspector.
I have a mail item in Outlook 2007 with custom properties, I try and send it to my own address, and then receive it without the custom properties.
I have verified that the user properties are in the mail in the send event.
I read somewhere that for this to work I have to select the "Send using Outlook Rich Text" Format option, but it didn't work either.
Can anyone tell me what's wrong?
I'm using Add-in Express. Here's the code I'm using for adding custom properties to the mail item:
var _Inspector = this.InspectorObj as Outlook.Inspector;
if (_Inspector != null)
{
var _Item = _Inspector.CurrentItem as Outlook.MailItem;
var _UserProperties = _Item.UserProperties;
var _UserProperty1 = _UserProperties.Item(PropertyNames.UserProperty1);
if (_UserProperty1 == null)
{
_UserProperties.Add(PropertyNames.UserProperty1, Outlook.OlUserPropertyType.olText, true, Type.Missing);
_UserProperty1 = _UserProperties.Item(PropertyNames.UserProperty1);
}
var _UserProperty2 = _UserProperties.Item(PropertyNames.UserProperty2);
if (_UserProperty2 == null)
{
_UserProperties.Add(PropertyNames.UserProperty2, Outlook.OlUserPropertyType.olText, true, Type.Missing);
_UserProperty2 = _UserProperties.Item(PropertyNames.UserProperty2);
}
_UserProperty1.Value = "Test Value 1";
_UserProperty2.Value = "Test Value 2";
_Item.Save();
}
Thanks in advance.