Setting the “To” field on a post item

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

Setting the “To” field on a post item

Posts: 15
Joined: 2010-05-06
I have a custom class that is derived from Post called: "IPM.Post.CustomType" I have these items in the inbox and I'm trying to set the to field to show recipients. I've tried setting the following properties with no success. Any ideas? Or if I'm using a post item, will the to field always display as empty in Outlook?

OutlookItem.PropertyAccessor.SetProperty("urn:schemas:httpmail:displayto", "blah");

var aixStoreAccessor = new AddinExpress.MAPI.ADXMAPIStoreAccessor();
var aixItem = aixStoreAccessor.GetMapiItem(OutlookItem);
aixItem.SetProperty(AddinExpress.MAPI.ADXMAPIPropertyTag._PR_DISPLAY_TO, "1");
aixItem.SetProperty(AddinExpress.MAPI.ADXMAPIPropertyTag._PR_DISPLAY_TO_A, "2");
aixItem.SetProperty(AddinExpress.MAPI.ADXMAPIPropertyTag._PR_DISPLAY_TO_W, "3");
aixItem.SetProperty(AddinExpress.MAPI.ADXMAPIPropertyTag._PR_ORIGINAL_DISPLAY_TO, "4");
aixItem.SetProperty(AddinExpress.MAPI.ADXMAPIPropertyTag._PR_ORIGINAL_DISPLAY_TO_A, "5");
aixItem.SetProperty(AddinExpress.MAPI.ADXMAPIPropertyTag._PR_ORIGINAL_DISPLAY_TO_W, "6");
aixItem.SetProperty(0x00008536, "7"); // PidLidNonSendableTo
aixItem.SetProperty(AddinExpress.MAPI.ADXMAPIPropertyTag._PR_RECEIVED_BY_NAME, "8");
aixItem.SetProperty(AddinExpress.MAPI.ADXMAPIPropertyTag._PR_RECEIVED_BY_NAME_A, "9");
aixItem.SetProperty(AddinExpress.MAPI.ADXMAPIPropertyTag._PR_RECEIVED_BY_NAME_W, "10");
Posted 06 May, 2010 21:47:49 Top
Andrei Smolin

Add-in Express team

Posts: 14114
Joined: 2006-05-11
Hi Matt,

I've called the code line below in VBA:
anItem.PropertyAccessor.SetProperty "urn:schemas:httpmail:displayto", "blah"

It produces "The property "urn:schemas:httpmail:displayto" does not support this operation."

I assume, it's impossible to modify that property. I suggest using Outlook Spy in order to find properties that can be modified.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 07 May, 2010 03:28:14 Top