The ObjectRenderer object is very similar to the ContainerRenderer object in both its methods and properties. The only difference between them is that the ObjectRenderer object is used to render information on a single object and not a container. The data sources accepted by the ObjectRenderer object are AddressEntry, AppointmentItem, Attachment, Folder, MeetingItem, and Message objects. The following section highlights the
The methods on the ObjectRender object are
. Some are exactly the same as the methods used on the ContainerRenderer object. For more information on the ObjectRenderer methods, refer to the ContainerRenderer object. The one method that
The ObjectRenderer object properties are a subset of the ContainerRenderer properties. The most important properties for the ObjectRenderer are the DataSource, Formats, and LinkPattern properties. For more information on the Formats and LinkPattern properties, see the descriptions in the section on the ContainerRenderer object.
The DataSource property returns or sets the CDO object from which you want to render specific properties. The CDO object types this property can accept are the AddressEntry, AppointmentItem, Attachment, Folder, MeetingItem, and Message objects.
The Formats collection contains zero or more Format objects that are used to specify how certain properties are rendered. By creating Format objects in the Formats collection, you can create new ways to render your own or built-in properties using the Rendering library.
The following section describes the Add method of the Formats collection.
method is the only method on the Format collection. It creates and returns a new Format object. The
method has one required parameter and one optional parameter. The required parameter specifies the property tag or the name of a custom property that is to be formatted by the new Format object. The optional parameter is a string that specifies the
The following example shows you how to create a format for the sensitivity of a message:
Set objFormat = objRenderer.Formats.Add(ActMsgPR_SENSITIVITY, Null) Set objPatterns = objFormat.Patterns bstrHTML = bstrImgSrc + _ "/images/private.gif WIDTH=13 HEIGHT=13 BORDER=0>" objPatterns.Add 1, bstrHTML ' personal objPatterns.Add 2, bstrHTML ' private objPatterns.Add 3, bstrHTML ' confidential objPatterns.Add "*", "" ' normal
The only interesting properties of the Formats collection are the Count and Item properties. The Count property returns the number of Format objects in the collection. The Item property allows you to retrieve a Format object by using the object's index, name, or property tag. The following example uses the Count and Item properties together:
For i = 1 To objFormatsColl.Count Response.write objFormatsColl.Item(i).Name Next
The only method on the Format object is the Delete method, which deletes the current Format object from the Formats collection.
The following sections describe the properties of the Format object.
The Name property returns or sets the reference name for the Format object. This property is available only on special-purpose formats that do not represent specific properties.
Patterns specify the way CDO should render the property. When you create formats, you must specify patterns for them. The Patterns property can return either a single Pattern object or the Patterns collection. When no parameter is passed to the Patterns property, the property returns the full Patterns collection. If you pass an index to the Patterns property, it will return the corresponding Pattern object.
The Property property returns the name or the property tag that corresponds to the Format object.