Programming Microsoft Outlook and Microsoft Exchange, Second Edition (DV-MPS Programming)

The CDO library is a hierarchical library consisting of objects and collections. Throughout this hierarchy, you can create children objects from their parent objects. As you read the chapter, you'll find the same collection for different objects. While these duplicated collections might have the same name, the information each accesses is specific to the object each refers to.

In the CDO library, the Session object is the highest-level parent of all the other objects and contains all objects and collections. This makes sense since you need some type of session, either an Exchange Server session or an offline session, to start accessing information stored in an Exchange Server database. Figure 11-1 shows the hierarchy of the CDO library, which begins with the Session object.

NOTE


If you're familiar with ActiveX Data Objects (ADO), it might be helpful to know that the Session object is similar to the ADO Connection object. However, do not confuse the Session object in ASP with the Session object in CDO. They are two entirely different objects.

Figure 11-1 The CDO library hierarchy. Notice how all other objects are created from the CDO Session object.

As you can see from Figure 11-1, the CDO library is quite logical in its layout of collections and objects. Below the Session object are the major collections and objects of the CDO library, such as the InfoStores collection, which contains the data stores for your application, and the AddressLists collection, which contains the address entries your application can use. Below these major collections are other collections such as the Folders collection, which contains the folders for a particular InfoStore, and the Messages collection, which contains the messages for a particular folder. The CDO library is one of the most approachable Microsoft object libraries and allows you to quickly build powerful collaborative applications.

Getting Help with the CDO Library

While this chapter provides an overview of the CDO library, you might also want to look at the CDO help file, which provides useful information as well as code samples. The CDO Windows Help file (cdo.hlp) can be found on the Exchange Server 5.5 CD or on the Outlook 98 CD. The CDO compiled HTML Help file (cdo.chm) is available on the companion CD. It is also available as part of the Platform SDK section of the MSDN Library, which can be accessed online at http://msdn.microsoft.com/developer/sdk/.

For additional CDO information, refer to the "Programming Outlook and Exchange Supplement" on the companion CD. Use it to learn about the CDO library methods and properties not discussed in this chapter. Also refer to the section at the end of this chapter, which contains some tips and tricks for building CDO applications.

Категории