Rendering Collections

The ContainerRenderer object is used to render one or more properties from a collection of MAPI objects, as shown in the following procedure.

    To render a collection
  1. Open the collection within the MAPI object, such as the Inbox.Messages collection or the Inbox.Folders collection. For example, to open the Messages collection of the logged-in user's Inbox, use objSession.Inbox.Messages.
  2. If it does not already exist, create the ContainerRenderer object with a call such as objRenderApp.CreateRenderer Method ( class ). For more information, see About Renderer Objects.
  3. Set the DataSource to the collection to be rendered with a command such as Set objCR.DataSource = Inbox. For more information, see Setting the Data Source.
  4. Optionally, to create active links, set the LinkPattern property. For more information, see Named Formats.
  5. Add any additional Formats needed to render your collection. For example, to render the contents table of an Inbox, you will probably need to include formats for the MAPI properties PR_IMPORTANCE, PR_MESSAGE_CLASS, and PR_HASATTACH.
  6. Render the object. For collections, you will generally render directly to the screen.