Ken Lassesen
Microsoft Developer Network Technology Group
October 26, 1995
Click here for a diagram of the OLE Messaging Object Library in various graphics formats.
This article consists primarily of a graphic map of the OLE Messaging Object 1.0 (MAPI), showing its properties, methods, and child objects. This object manipulates messages in Microsoft® Exchange and may be accessed using Visual Basic®, Visual Basic for Applications, or Visual C++™.
The OLE Messaging Object Library enables the developer to manipulate messages, attachments, folders, and addresses in Microsoft Exchange.
The OLE Messaging object (MAPI) is accessible from Visual C++™ and many products that include Visual Basic® for Applications, including Microsoft® Excel version 5.0 and higher, Microsoft Access 95, Visual Basic version 4.0, Microsoft Project, and Visual C++ version 4.0. For further information on using this object, see the Win32® SDK documentation (Development Library, Product Documentation, SDKs), and search the Development Library CD. A good starting point is my article "Using Microsoft OLE Automation Servers to Develop Solutions."
Note At the time of this writing (October 1995), the OLE Messaging object is still in beta testing. The object will be different when released.
Figure 1 shows the relationship between objects as described by the Object Viewer and online Help files. A map is a good learning aid and a quick reference when developing an application. After producing a map, I found that it was easy to work with the object: I just post the appropriate map on my wall for quick reference, which is a lot faster than clicking objects in a Help file one by one to discover their properties and methods.
Because Figure 1 is unreadable online, I have included the two most common graphics formats—encapsulated PostScript™ (.EPS) and Windows® metafile (.WMF)—as well as a copy of my original Shapeware® Visio™ version 4.0 file (.VSD). The first two formats can be printed across multiple pages using any of the commercial graphics applications—such as Adobe™ PageMaker™, Corel® Draw, or Microsoft Publisher—or using Microsoft Excel. The original Visio file is included for those who have a copy of Visio and wish to modify the diagram easily.
Figure 1. The OLE Messaging object
The objects and collections in Figure 1 are defined in Table 1. The objects are listed in the same sequence as they appear in the map.
Table 1. Object and Collection Definitions
Object or Collection | Definition |
Session object | This collection contains the DocumentProperty objects. This is also know as the summary information. |
Folders collection | This collection contains a collection of folders. This object may occur in the session or in a folder. |
Folder object | This object contains a collection of messages and folders. |
Messages collection | This collection contains all of the messages in one folder. |
Message object | This object contains the message text, the attachments, and recipients of the e-mail. |
Attachments collection | This collection contains all of the files attached to the e-mail. |
Attachment object | This object contains information about one file attached to the e-mail. |
Recipients collection | This collection contains the list of all the recipients of the e-mail. It includes the Send to, Copy to and Blind Copy to properties. |
Recipient object | This object represents information about one recipient of the e-mail. |
AddressEntry object | This object contains information about an e-mail address. |
InfoStores collection | This collection contains all of the InfoStore objects. |
InfoStore object | This object contains an information storage object. Different mail service providers can be accessed in Microsoft Exchange. |
MAPIOBJECT | This is not available to products containing Visual Basic for Applications. |
Lassesen, Ken. "Using Microsoft OLE Automation Servers to Develop Solutions." October 1995. (Development Library, Technical Articles, Office 95 Articles)
"OLE Messaging Help." (OLEMSG.HLP) in installed with the OLE Messaging portion of the Win32 SDK.