Partager via


Properties Overview

Outlook Properties

A property is an attribute of a Microsoft Outlook object. Properties describe something about the object, such as the sender of a message item, or the number of items in a folder. Outlook defines many properties; these are referred to as built-in properties in this documentation. The Outlook object model exposes many built-in properties with string names, such as the Subject property of a mail item. These properties are further qualified as explicit built-in properties. Customers and service providers can extend the predefined properties of Outlook by creating new, custom properties. For example, through custom forms, customers can define properties to extend the functionality for a specific message class, and service providers can define properties to expose the unique features of their messaging system.

Object Model Entry Points

The Outlook object model provides several approaches to access Outlook properties, such as:

Note

Although ItemProperties and UserProperties support enumerating explicit built-in properties, and UserProperties.Find supports searching for explicit built-in properties, use these objects primarily for custom properties of item objects. Use the PropertyAccessor object to access properties of non-item objects, or item-level properties that are not explicitly exposed in the Outlook object model.

The following table shows when to use which entry points:

Object.Property

UserProperty, UserProperties

ItemProperty, ItemProperties

PropertyAccessor

Action on Properties

Get and set explicit built-in properties of item objects.

Enumerate, create, get, set, and remove custom properties of item objects.

Enumerate explicit built-in properties and custom properties of item objects; create, get, set, and remove custom properties of item objects.

Get and set built-in properties, and create, get, set, and remove custom properties. Objects include item objects and the following: AddressEntry, AddressList, Attachment, ExchangeUser, ExchangeDistributionList, Folder, Recipient, and Store. Access properties by the appropriate namespaces. For more information, see Referencing Properties by Namespace.

Performance

No performance overhead.

Enumerating and accessing properties using UserProperties can incur performance overhead.

Enumerating and accessing properties using ItemProperties can incur performance overhead.

Using the PropertyAccessor to access properties incurs performance overhead. For getting or setting multiple properties, use GetProperties and SetProperties as opposed to repeated calls to GetProperty and SetProperty.