RenderUsing Property (Pattern Object)
RenderUsing Property (Pattern Object)
Important The Collaboration Data Objects (CDO) 1.2.1 Rendering objects are not installed by or supported for use with Exchange Server 2003 or later.
The RenderUsing property returns or sets a rendering source that determines how a particular value set of a designated property is rendered. Read/write.
Syntax
objPattern.RenderUsing
Data Type
Variant (String)
Remarks
The RenderUsing property provides a source for rendering a property into HTML hypertext. The property to be rendered is designated in the parent Format objects Property property. If that property has the value or values specified in this patterns Value property, this RenderUsing string is used to render it. Otherwise, the rendering uses a pattern with a matching Value property.
If the renderable property is a column property in a table view, the rendering information is taken from the Column objects RenderUsing property. If no column rendering information is available, the rendering object searches for a format representing the renderable property. If no such format can be found, or if the format contains no pattern with a value match, the property is rendered by default according to its data type and value.
If the RenderUsing string contains substitution tokens within percent signs, such as %value%, the tokens are replaced by the appropriate attributes of the designated property to generate the HTML hypertext. If there are no substitution tokens in the string, the string itself is rendered without modification.
This approach lets you keep compact values in a property, such as enumerated integers instead of lengthier strings. You can then use the integer value as an index into the Patterns collection through each patterns Value property. The patterns RenderUsing property can contain the rendering string appropriate for that particular integer value.
The substitution tokens that can be inserted in a rendering source are as follows:
Substitution token |
Attribute of property being rendered |
%apptlength% |
For a property on an AppointmentItem object being viewed in CdoModeCalendarDaily mode, the number of rows spanned by the appointment or free block. |
%apptwidth% |
For a property on an AppointmentItem object being viewed in CdoModeCalendarDaily mode, the number of columns spanned by the appointment or free block. |
%classpath% |
For a property on a Message object, the message class expressed as a lowercase string, such as ipm.note. For a report message class, only the first and last elements are retained, so that REPORT.IPM.Note.NDR is expressed as report.ndr. When the application sets the FormsRoot property of the RenderingApplication object, a special-purpose format named %classpath% is created, which further processes the output of this token. |
%columns% |
For a property on an AppointmentItem object being viewed in CdoModeCalendarDaily mode, the total number of columns in the view. |
%date% |
For a property on an AppointmentItem object, the day for which appointments are being rendered, expressed as a string. |
%kvalue% |
For a numeric property, its value expressed in kilobytes, that is, the value divided by 1024. This value is rendered without a K character. |
%obj% |
For a property on any object, the unique identifier of the object, expressed as a hexadecimal string. |
%parentobj% |
For a property on a Message object, the unique identifier of the parent folder of the message, expressed as a hexadecimal string. |
%rowid% |
For a property on an object in a calendar view or a table view, the position of the object in its containing table. This position is also the row number in the view. |
%tablewidth% |
For a property on an object in a calendar view, the sum of the pixel widths of all the columns in the view, expressed in pixels. The %tablewidth% token is primarily useful for the TablePrefix property of the ContainerRenderer object. |
%time% |
For a property on an AppointmentItem object being viewed in CdoModeCalendarDaily mode, the time of the time slot currently being rendered, expressed as a string. If the slot begins on an hour boundary, the string contains the hour and either "AM" or "PM". Otherwise, the string contains the time separator character and the starting minute. |
%value% |
For a property on any object, the value of the property, rendered according to the propertys data type. In the context of the CellPattern or HeadingCellPattern property of the ContainerRenderer object, the string returned by the Pattern object's RenderUsing property or the Column object's RenderUsing property. |
A substitution token can also contain the name of a Format object between the percent signs. If the token matches a formats Name property, the patterns of that format are searched to find the RenderUsing string. This approach lets you bypass the predefined tokens and customize your rendering.
If the character string between the percent signs is not a valid substitution token or format name, the property is rendered by data type. If a token is valid but does not apply to the property being rendered, for example a %kvalue% token for a string property, nothing is rendered in place of the token.
More than one substitution token can be included in a RenderUsing string, for example %value%, %obj%, and %parentobj%.
The %classpath% token is rendered from the MAPI property PR_MESSAGE_CLASS. The %obj% token is rendered from a long-term entry identifier if one is available in the underlying table, and otherwise from the MAPI property PR_ENTRYID. The %parentobj% token is rendered from the MAPI property PR_PARENT_ENTRYID, and the %rowid% token from the MAPI property PR_ROWID.
The PR_MESSAGE_CLASS property can contain characters that are illegal in file names and URLs, namely blanks, double quotes, and any of the characters in the string "<>[]\*:;'/|?@=&%#". If CDO encounters any such character when rendering %classpath%, it converts it to an underscore followed by a two-character string representing the hexadecimal value of the original character. This is particularly important when CDO is rendering forms.
Example
The renderable property is specified in a columns Property property, or a formats Property property if the column does not supply rendering information.
If the renderable property contains a string:
www.example.com
and the RenderUsing string contains a substitution token:
<A HREF=http://%value%>Example Company Name</A>
it is rendered with the token replaced by the appropriate attribute:
<A HREF=http://www.example.com>Example Company Name</A>
If the RenderUsing string contains no substitution token:
<A HREF=http://example.com>Example Company Name</A>
it is rendered unchanged:
<A HREF=http://example.com>Example Company Name</A>
If the RenderUsing string contains an invalid or misspelled token:
<A HREF=http://%valu%>Example Company Name</A>
it is rendered with the token unchanged:
<A HREF=http://%valu%>Example Company Name</A>
If the RenderUsing property contains an inapplicable token:
<A HREF=http://%kvalue%>Example Company Name</A>
it is rendered without any output for the token:
<A HREF=http://>Example Company Name</A>