Visual Studio Tools for Office: Using C# with Excel, Word, Outlook, and InfoPath [Electronic resources]

Eric Carter, Eric Lippert

نسخه متنی -صفحه : 213/ 69
نمايش فراداده

Introduction to the Outlook Object Model

Regardless of the approach you choose to integrate your code with Outlook, you will eventually need to talk to the Outlook object model to get things done. This section introduces the Outlook object model; Chapter 10, "Working with Outlook Events," and Chapter 11, "Working with Outlook Objects," describe some of the most frequently used properties, methods, and events. This chapter also briefly examines another object model you can use with Outlook called Collaboration Data Objects (CDO).

The Object Hierarchy of the Outlook Object Model

The first step in starting to learn the Outlook object model is getting an idea for the basic structure of the object model hierarchy. Figure 9-11 shows some of the most critical objects in the Outlook object model and their hierarchical relationship.

Figure 9-11. The basic hierarchy of the Outlook object model.

The Outlook object model has the notion of an Outlook item. An Outlook item is represented in the object model as an object and can be cast to one of 15 different Outlook item types shown in Chapter 11 discusses Outlook items in more detail.

Figure 9-12 shows a more complete view of the Outlook object model. (All the objects considered Outlook items are colored gray.) Note in this diagram that the Inspector object and the Items object points to a gray circle, which represents any of the Outlook items colored gray.

Figure 9-12. Some of the objects in the Outlook object modelgray objects are all "Outlook items."

[View full size image]