Flylib.com

Books Software

 
 
 

ContainerRenderer Object

[Previous] [Next]

ObjectRenderer Object

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 methods and properties for this object.

ObjectRenderer Object Methods

The methods on the ObjectRender object are RenderDate , RenderLink , RenderProperty , and RenderTime . 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 differs is RenderLink .

RenderLink Method

The RenderLink method renders an HTML link to the specified object in the DataSource property. The way to render the link is specified in the LinkPattern property. The RenderLink method takes one optional parameter, which is the Response object to render the information to. This is usually the standard ASP Response object.

ObjectRenderer Object Properties

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.

DataSource Property

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.

[Previous] [Next]

Formats Collection and Format Object

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.

Formats Collection Methods

The following section describes the Add method of the Formats collection.

Add Method

The Add method is the only method on the Format collection. It creates and returns a new Format object. The Add 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 name to be assigned to the new Format object. It is used only for special-purpose formats. If you do use the optional parameter, the required parameter must be set to 0.

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

Formats Collection Properties

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

Format Object Methods

The only method on the Format object is the Delete method, which deletes the current Format object from the Formats collection.

Format Object Properties

The following sections describe the properties of the Format object.

Name Property

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 Property

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.

Property Property

The Property property returns the name or the property tag that corresponds to the Format object.