1
votes

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.

1
When you open the received mail, are you using the same outlook add-in on the target machine or any other client?Kapil
Exactly the same. I send from my address to my own address, open it in the same outlook session with the same add-in, and the properties are magically gone.Yandros
would you be able to post the code that you are using to add custom props to mail item.Kapil
Sure, but I don't know how that would help. As I said before, I verified that the user properties are there in the mail, and they are even in the Sent Items copy of the mail. (Added code in the main body of the question.)Yandros

1 Answers

1
votes

Custom properties are not sent over Internet email (http://support.microsoft.com/kb/907985).