Skip to Content
CDO & MAPI Programming with Visual Basic:
book

CDO & MAPI Programming with Visual Basic:

by Dave Grundgeiger
October 2000
Intermediate to advanced
384 pages
10h 22m
English
O'Reilly Media, Inc.
Content preview from CDO & MAPI Programming with Visual Basic:

Reading Mail

Assuming that a MAPI session has been established, reading mail is comprised of the following steps.

  1. Traverse the CDO object hierarchy to find a message of interest.

  2. Read the Message object’s properties to retrieve message information.

As explained in Chapter 5, message stores are databases that store messages. The user’s MAPI profile controls which message stores are available to the user. In CDO, a message store is represented by an InfoStore object. The Session object has an InfoStores collection, which in turn has one InfoStore object for each message store set up in the user’s profile. To discover what message stores exist for a user, iterate through the InfoStores collection. You’ll see an example of this in a moment.

Within each message store is a folder tree. To represent this in CDO, each InfoStore object has a RootFolder property, which contains a reference to a Folder object that acts as the root of the folder tree for that message store. The root Folder object doesn’t contain messages—only additional folders. The Folders property of the root Folder object references a collection of more Folder objects, each of which can contain a reference to another Folders collection as well as a reference to a Messages collection. The Messages collection has one Message object for each message in the folder. In this way, the MAPI folder hierarchy can be traversed using the CDO object hierarchy.

Example 6-2, taken from this chapter’s sample application, shows how ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Excel® 2007 VBA Programmer's Reference

Excel® 2007 VBA Programmer's Reference

John Green, Stephen Bullen, Rob Bovey, Michael Alexander
COM Programming with Microsoft® .NET

COM Programming with Microsoft® .NET

John Paul Mueller, Julian Templeman

Publisher Resources

ISBN: 156592665XSupplemental ContentCatalog PageErrata