Rendering Individual Object Properties
The ObjectRenderer object is used to render one or more properties, rather than an entire object. The following procedure shows the steps you would take to render a property on an object.
To render an object property
-
Open the MAPI object, such as a message or a user's Inbox. For example, to open the Inbox belonging to logged-in user, use objSession.Inbox.
-
If it does not already exist, create the ObjectRenderer object with a call such as objRenderApp.CreateRenderer ( class ). For more information, see About Renderer Objects.
-
Set the DataSource property to the object that contains properties to be rendered with a command such as Set objObjectRenderer.DataSource = objMessage. For more information, see Setting the Data Source.
-
Optionally, depending on the property type of the property to be rendered, set Formats.
-
Render the property. This call specifies what property of the object to render. For example, to render the subject of the message, you would have set the data source to be the message, and call the RenderProperty method to render the subject, specifying the MAPI property. You have the choice of rendering either directly to the screen or to a string.