RDOUserProperties object |
RDOUserProperties collection contains custom properties of an Outlook item. Note that this collection is compatible with the UserProperties collection in the Outlook Object Model (see MSDN).
On the MAPI level user property values are stored as regular named MAPI properties, but Outlook also stores the properties definitions in a special binary blob, which in turn is stored in another named MAPI property on the item.
You can access the values of the user properties using MAPIProp.Fields, but RDOUserProperties collection allows to modify the user properties definitions, which are also used when designing a form or when managing folder fields (see RDOFolderFields).
Returned by:
RDOMail.UserProperties (and all other objects derived from RDOMail- RDOAppointmentItem, RDOContactItem, RDOTaskItem, etc).
The example below create a new task and adds a new user property of type olFormula.
set Session =
CreateObject("Redemption.RDOSession") |
Derived from: IDispatch |
||||||||||||||||||||||||
|
||||||||||||||||||||||||
Properties |
||||||||||||||||||||||||
|
||||||||||||||||||||||||
Count |
Returns an integer indicating the count of user properties in the RDOUserProperties collection. Read-only.
|
|||||||||||||||||||||||
Methods |
||||||||||||||||||||||||
|
||||||||||||||||||||||||
Add(Name, Type, AddToFolderFields, DisplayFormat) |
Creates a new user property in the RDOUserProperties collection. If the property with the same name already exists, it will be returned unless the the old property type is different from the the current type, in which case an error will be raised. Returns RDOUserProperty object.
Name - the name of the property
Type - one of the rdoUserPropertyType enums.
olText (0x1) olInteger (0x14)
AddToFolderFields - optional, boolean. True if the property will be added as a custom field to the folder that the item is in. This field can be displayed in the folder's view. False if the property will not be added as a custom field. The default value is False.
DisplayFormat, integer, optional. If not specified, defaults to 0. Used only if AddToFolderFields parameter (see above) is true. The meaning and the possible values of the DisplayFormat parameter depend on the value of the Type parameter. This parameter is essentially a zero based index of the entry selected from the "Format" combobox in the "Field Chooser" dialog in Outlook:
|
See the example above
|
||||||||||||||||||||||
AddDefaultFormProperties |
Previously,
RDOUserProperties object opened the MAPI
form responsible for the custom message class and read its default
properties. RDOItems.Add
performed similar steps when a message with a custom class was created.
MAPI forms represent a significant performance and stability problem,
hence that code was moved to an explicit
RDOUserProperties.AddDefaultFormProperties
method. |
set Session = CreateObject("Redemption.RDOSession") Session.MAPIOBJECT = Application.Session.MAPIOBJECT set Msg = Session.GetDefaultFolder(olFolderDrafts).Items.Add("IPM.Note") Msg.Subject = "Required property" Msg.UserProperties.AddDefaultFormProperties Msg.Save |
||||||||||||||||||||||
Find(Name, Custom) |
Locates and returns an RDOUserProperty object for the requested user property name, if it exists, or null if it does not.
Name - the name of the property.
Custom - variant, optional. If TRUE, only custom user properties are searched. If FALSE, built-in Outlook Object Properties (e.g. Subject) are returned. The default value is TRUE.
|
set Session = CreateObject("Redemption.RDOSession") Session.logon set msg = Session.GetDefaultFolder(olFolderDrafts).Items.Add set Prop = msg.UserProperties.Find("Subject", false) Prop.Value = "New Subject value" Msg.Save |
||||||||||||||||||||||
Item(Index) |
Locales and returns an RDOUserProperty object with the specified index (if the Index parameter is an integer) or a name (if the Index parameter is a string).
Index - variant. Either a 1 based index of the user property or a string (user property name).
|
|||||||||||||||||||||||
Remove(Name) |
Removes the user property with the specified name from the collection.
.Name - the name of the property |
|||||||||||||||||||||||
|