DataSource Property (ContainerRenderer Object)

DataSource Property (ContainerRenderer 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 DataSource property contains the CDO container object to be rendered. Read/write.



Data Type

Object (AddressEntries collection, Folders collection, Messages collection, or Recipients collection)


The DataSource property accepts an AddressEntries, Folders, Messages, or Recipients collection.

Setting the DataSource property specifies the container object to be rendered and instantiates a new Views collection for the container renderer. Any previous folder views are released and replaced from the new Views collection. All common and personal views remain in effect, and any existing custom views are also retained.

If you are rendering an address book container, you must define one or more custom views for it, because it has no predefined common, personal, or folder views. Furthermore, you must Add any new custom views to the present Views collection before you set DataSource to an AddressEntries collection. Otherwise the new custom views are not handled properly in the rendering.

Setting the DataSource property repopulates the collection underlying the container object and revises its filter, just as setting the container renderers CurrentView property does. Any previous settings of the filter are ignored.

If you are preparing to render a folder and set DataSource to a Folders or Messages collection, the CurrentView property is automatically reset to the new Views collection's default current view. If you are not rendering a folder, DataSource and CurrentView operate independently, so when you set DataSource to an object other than a Folders or Messages collection, CurrentView is left unchanged.

For more information, see Rendering Container Objects.

You must Set the DataSource property to Nothing, or Set the ContainerRenderer object to Nothing, before you call the Session object's Logoff method. Failure to do so can result in unexpected behavior.


This code fragment assigns the DataSource property to the Messages collection of the Session object's Inbox folder:

' assume valid ContainerRenderer and Session objects
Set objInbox = objSession.Inbox
objContRend.DataSource = objInbox.Messages

See Also


ContainerRenderer Object