Microsoft KB Archive/178553

= INFO: Accessing Custom Attributes of Recipients =

Article ID: 178553

Article Last Modified on 8/18/2005

-

APPLIES TO


 * Microsoft Collaboration Data Objects 1.21
 * Microsoft Collaboration Data Objects 1.1
 * Microsoft Collaboration Data Objects 1.2
 * Microsoft Messaging Application Programming Interface
 * Microsoft Exchange Development Kit 5.5

-



This article was previously published under Q178553



SUMMARY
The following table contains the property identifiers and property tags you can use to access the values of the Custom Attributes of Recipients on Microsoft Exchange Server.   Custom Attribute  Property ID  Property Tag  Property Name

1         0x802D       0x802D001E    PR_EMS_EXTENSION_ATTRIBUTE_1 2         0x802E       0x802E001E    PR_EMS_EXTENSION_ATTRIBUTE_2 3         0x802F       0x802F001E    PR_EMS_EXTENSION_ATTRIBUTE_3 4         0x8030       0x8030001E    PR_EMS_EXTENSION_ATTRIBUTE_4 5         0x8031       0x8031001E    PR_EMS_EXTENSION_ATTRIBUTE_5 6         0x8032       0x8032001E    PR_EMS_EXTENSION_ATTRIBUTE_6 7         0x8033       0x8033001E    PR_EMS_EXTENSION_ATTRIBUTE_7 8         0x8034       0x8034001E    PR_EMS_EXTENSION_ATTRIBUTE_8 9         0x8035       0x8035001E    PR_EMS_EXTENSION_ATTRIBUTE_9 10         0x8036       0x8036001E    PR_EMS_EXTENSION_ATTRIBUTE_10



Collaboration Data Objects (1.1, 1.2, 1.21)
To retrieve the property using Collaboration Data Objects (1.1, 1.2, 1.21) (formerly known as Active Messaging), use the Fields collection of the AddressEntry property on the Recipient object. Here is the syntax:

objRecip.AddressEntry.Fields(&H########).Value

For example, the following code displays the value of Custom Attribute 7 in a message box. (This code assumes the variable objRecip points to a resolved Recipient object on Microsoft Exchange Server.) MsgBox objRecip.AddressEntry.Fields(&H8033001E).Value For more information and a complete sample how to access properties of recipients from a Visual Basic application or Visual Basic Script, please see the following articles in the Microsoft Knowledge Base:

179082 HOWTO: Read Address Book Properties from ASP Page with VBScript

179083 HOWTO: Read Address Book Properties in Visual Basic

Extended MAPI
To retrieve the property using Extended MAPI, use the IMAPIProp::GetProps method on the IMailUser object, or the HrGetOneProp function. You must ensure that the recipient has been resolved to the Microsoft Exchange Server Global Address List.

