none
Recipient.PropertyAccessor.SetProperty throwing error: Object doesn't support property "http://schemas.microsoft.com/mapi/string/{guid}/{name}" RRS feed

  • Question

  • When I'm trying to set a custom property to a recipient item using PropertyAccessor.SetProperty I'm getting the following exception:

    System.Runtime.InteropService.COMException: 'Object does not support property "http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/pname"'

    Below is the code snippet

    string propertyName = "http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/pname";
    
    string value = "some string....";
    
    foreach(Outlook.Recipient recipient in mailItem.Recipients)
    {
        recipient.PropertyAccessor.SetProperty(propertyName, value);
    }

    I used both "http://" and "https://" in the property name but no luck.


    • Edited by MA90 Saturday, August 25, 2018 5:10 PM
    Saturday, August 25, 2018 5:08 PM

Answers

  • GAL provider uses fixed properties in the >= 0x80000000 range, which is the range reserved for the named properties, and that makes it impossible to mix named and fixed GAL properties on recipients, even if OOM would let you set properties like that.

    A good rule of thumb is to see if Outlook ever stores named properties in the recipient table - it does not. Take a look at any message with OutlookSpy (click IMessage button and go to the GetRecipientTable tab).


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by MA90 Thursday, September 20, 2018 5:27 PM
    Saturday, August 25, 2018 6:44 PM

All replies

  • As a general rule, recipients do not support named properties. You should be able to set a fixed property (such as PR_COMMENT, DASL name "http://schemas.microsoft.com/mapi/proptag/0x3004001F").

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Saturday, August 25, 2018 5:22 PM
  • When I'm trying to set a custom property to a recipient item using PropertyAccessor.SetProperty I'm getting the following exception:

    System.Runtime.InteropService.COMException: 'Object does not support property "http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/pname"'

    Below is the code snippet

    string propertyName = "http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/pname";
    
    string value = "some string....";
    
    foreach(Outlook.Recipient recipient in mailItem.Recipients)
    {
        recipient.PropertyAccessor.SetProperty(propertyName, value);
    }

    I used both "http://" and "https://" in the property name but no luck.


    See https://msdn.microsoft.com/en-us/library/ee219916(v=exchg.80).aspx
    Saturday, August 25, 2018 5:23 PM
  • According to msdn reference docs https://docs.microsoft.com/en-us/office/vba/outlook/how-to/navigation/referencing-properties-by-namespace, the Recipient object should support the named property

    Or am I interpreting it wrongly?

    -Thanks

    Saturday, August 25, 2018 5:37 PM
  • GAL provider uses fixed properties in the >= 0x80000000 range, which is the range reserved for the named properties, and that makes it impossible to mix named and fixed GAL properties on recipients, even if OOM would let you set properties like that.

    A good rule of thumb is to see if Outlook ever stores named properties in the recipient table - it does not. Take a look at any message with OutlookSpy (click IMessage button and go to the GetRecipientTable tab).


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by MA90 Thursday, September 20, 2018 5:27 PM
    Saturday, August 25, 2018 6:44 PM