Child Objects

Child Objects

All CDO Library objects can be considered as relative to a Session object. A session's immediate child objects are the AddressLists collection object, the InfoStores collection object, and the Inbox or Outbox Folder object. These provide access, respectively, to the root of the address book hierarchy for the current session, the set of all message stores available to the session, and the current default Inbox and Outbox folders.

The session's child objects have their own child objects, which in turn have child objects, and so on. This hierarchy permits increasingly detailed levels of access. The AddressLists collection, for example, contains one or more AddressList child objects, each representing one available address book container. Each of these has as its child an AddressEntries collection containing AddressEntry child objects. Each address entry that is a distribution list has a Members property that provides another AddressEntries collection for the members of the distribution list.

See the Object Model diagram for the logical hierarchy of the CDO Library.

In addition to the hierarchy of objects, each object has properties and methods. The hierarchy is important because it determines the correct syntax to use in your Visual Basic applications. In your Visual Basic code, the relationship between a parent object and a child object is denoted by the left-to-right sequence of the objects in the Visual Basic statement. For example,

objSession.AddressLists("Personal Address Book").AddressEntriesColl(2)
 

refers to the second AddressEntry object in the AddressEntries collection of the current session's personal address book (PAB) AddressList object.