Export (0) Print
Expand All

Getting the Value of a Property

Outlook provides several ways to get the value of a property:

Object.Property

UserProperty.Value

ItemProperty.Value

PropertyAccessor.GetProperty

PropertyAccessor.GetProperties

Action

Gets the value of the specified explicit built-in property.

Gets the value of the specified custom item-level property. No action takes place if the property does not exist.

Gets the value of the specified built-in or custom item-level property, provided the property is not a blocked property. No action takes place if the property does not exist.

Gets an object that represents the value of the property specified by SchemaName, provided the property is not a blocked property. Returns an error if the property does not exist.

For each property in SchemaNames, provided the property is not a blocked property, gets the value of the property into a corresponding element in a variant array. Returns the variant array with property values when PropertyAccessor.GetProperties obtains the value of all the properties in SchemaNames. Returns errors in the array otherwise.

Applicable Objects

All objects in the Outlook object model.

All Outlook item objects including Microsoft Office document items (DocumentItem objects)

All Outlook item objects including Microsoft Office document items (DocumentItem objects)

Use ItemProperty to get explicit built-in item-level properties. Use PropertyAccessor.GetProperty for item-level properties without explicit names, custom properties, or properties of any of the following objects: AddressEntry, AddressList, Attachment, ExchangeDistributionList, ExchangeUser, Folder, Recipient, and Store.

Same objects as stated in the GetProperty column.

Property Type Support

As specified in the Outlook object model.

Returns a Variant object.

Returns a Variant object.

The type of the object returned will be the same as the type of the property specified by SchemaName. If you require conversion of the raw property type to a string (for PT_BINARY in MAPI) or a local time (PT_SYSTIME), use the PropertyAccessor helper methods PropertyAccessor.UTCToLocalTime or PropertyAccessor.BinaryToString. The PropertyAccessor does not support certain MAPI property types, for example, PT_OBJECT, and attempting to get the value of properties of such types will return "Property operation not supported" error.

Property type support is the same as in the GetProperty column because the type of each value should be the same as the type of the corresponding property in SchemaNames. Any error including type mismatch is returned in the resultant array.

Security

On a client computer running Microsoft Office Outlook 2007 or later, without an appropriately set up antivirus software, untrusted code attempting to access protected properties will, by default, get the address book security warning.

Trusted and untrusted code can use the UserProperty object. On a client computer running Office Outlook 2007 or later without an appropriately set up antivirus software, untrusted code attempting to use the UserProperty object to access a protected property will, by default, get the address book security warning.

Trusted and untrusted code can use the ItemProperty object. On a client computer running Office Outlook 2007 or later without an appropriately set up antivirus software, untrusted code attempting to use the ItemProperty object to access a protected property will, by default, get the address book security warning.

On a client computer without an appropriately set up antivirus software, untrusted code attempting to access the PropertyAccessor property of an item object will by default invoke the address book security warning.

Same security considerations as in the GetProperty column.

Performance

No performance overhead. Use this whenever the property is an explicit built-in property.

No performance overhead. Use this object whenever the property is a custom property at the item-level.

No performance overhead. Use this object whenever the property is a custom item-level property.

Using the PropertyAccessor to access properties incurs performance overhead. For getting multiple properties, use PropertyAccessor.GetProperties as opposed to repeated PropertyAccessor.GetProperty.

Using the PropertyAccessor to access properties incurs performance overhead. For getting multiple properties, use GetProperties as opposed to repeated GetProperty.

Community Additions

ADD
Show:
© 2014 Microsoft