Using CDO Rendering

The CDO Rendering Library exposes a set of objects that can be used by Internet Information Server to render CDO objects and properties into HTML output. One example of this in CML/LitCrit involves the use of the CDO Rendering Library's ObjectRenderer object, which renders selected properties of a specified CDO object.

The following code is in the Message.asp file. In the first two lines, the objectID of the message to be rendered is assigned to a new message object, objOneMsg.

bstrObj = Request.QueryString("obj")
Set objOneMsg = Session(bstrObj)

Next, an ObjectRenderer object (objRenderMsg) is created with a call to the GetObjectRenderer function in the Microsoft Outlook Web Access script library file, render.inc. Then the object's DataSource property is set to the CDO Message object to be rendered:

Set objRenderMsg = GetObjectRenderer
objRenderMsg.DataSource = objOneMsg

Finally, the ObjectRenderer object is used a number of times to send screen elements such as a text field to the browser. In the first line that follows, the bstr__FieldData variable is assigned the description of the "Item Title" field. In the second line, this field is rendered:

<%bstr__FieldData=fm__GetFieldData(8,"","{2903020000000000C000000000000046}Item Title", False,0,1)%>
<% objRenderMsg.write bstr__FieldData, Response %>

Note the <% and %> delimiters, which separate the script code from the HTML.

Similarly, the CDO Rendering Library is used to display the combo boxes, images, and other user-interface elements on the converted forms, Message.asp and Message-read.asp. For general information, see Creating the CML/LitCrit Web Form.