Accessing user defined contact fields

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

Accessing user defined contact fields
 
Rick Dalgren




Posts: 11
Joined: 2006-06-26
Using Redemption in a stand-alone application, I've added four properties to contacts (I can write/read to these properties).

I would like to be able to access these properties in my add-in. I'm looking at the MAPI Store Accessor and I can see how to access them. While I see the enumeration for the property tags, I can't seem to figure out to find out the property tags for my properties.

Is this possible??

Thanks!
Posted 16 Jun, 2008 13:01:24 Top
Rick Dalgren




Posts: 11
Joined: 2006-06-26
Well, following the example for getting and setting the values in MAPI properties, I'm able to get the value from a contact (I'm getting the tag id from Redemption).

But, when I try to set the value, I get the following error:

The Client Operation Failed
Microsoft Exchange Information Store

Posted 16 Jun, 2008 15:09:29 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hello Rick,

To access a custom or user-defined property via the MAPI Store Accessor you should know the id of the property. The Outlook Object Model allows you to access user-defined properties via the UserProperties collection ( and there is no way to acces custom properties via OOM). I have tested the following code against an Exchange server in both cached and non-cached modes:


Outlook.NameSpace ns = OutlookApp.GetNamespace("MAPI");
Outlook.MAPIFolder folder = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);
Outlook.ContactItem item = folder.Items.Item(1) as Outlook.ContactItem;
int ok = adxmapiStoreAccessor1.SetProperty(item, 0x65600003U, 111);
if (ok == 0)
{
    System.Windows.Forms.MessageBox.Show("Succeded");
}


.NET, Extended MAPI, Windows Phone & RT
Posted 17 Jun, 2008 04:45:18 Top