Folders with Special Status

Clearly, some folders in the MAPI message store hierarchy have unique status. The Inbox and Outbox folders are obvious examples. Indeed, these two folders are so important that the Session object maintains explicit references to them for easy access. Furthermore, if their names are changed, they nevertheless retain their unique functionality. I changed the name of my Inbox folder to “foo.” When new messages come in, they dutifully appear in the foo folder. Why?

After a message store provider is added to a profile as the profile’s default message store, MAPI does some additional magic on our behalf. The first time a process logs on to MAPI using that profile, MAPI creates several special folders that clients are guaranteed will always exist. They are:

Deleted Items

The folder where deleted items are stored.

Inbox

The folder where new messages are stored after having been received by a transport provider.

Outbox

The folder where outgoing messages are stored while waiting to be serviced by a transport provider.

Sent Items

The folder where outgoing messages are stored after they’ve been transmitted by a transport provider.

Once MAPI creates these folders, they retain special significance regardless of how their names are changed. There is no facility for transferring the special status of one of these folders to a different folder. Deleting any of these folders programmatically is likely to make your message store provider unusable.

In addition to the special ...

Get CDO & MAPI Programming with Visual Basic: now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.