Microsoft Office Tutorials and References
In Depth Information
Referencing the MAPI Namespace
In some of the code examples in this and following chapters, you’ll see code that explicitly gets the
MAPI namespace. In other code, particularly short snippets, it will be assumed that this has already
Constants for the GetDefaultFolder Method’s foldertype Argument
Items that have been deleted
Drafts of incompleted items
Received email messages
Email messages waiting to be sent
Email messages that have been sent
Referencing User-Created Folders
Folders that the user has created are not default Outlook folders and references to them are
obtained from the Folders collection. Because folders can themselves be organized in a hierarchy,
things are arranged as follows:
n Each top-level folder is a member of the NameSpace object’s Folders collection.
n Each of these top-level folders has its own Folders collection, which contains any
subfolders that the folder contains.
n Each folder in turn has its own Folders collection.
User-created folders are identified by name, which is obtained from the Folder object’s name
property. To get a reference to a folder, assuming that you do not know exactly where it is located,
you must look through all folders until you either find it or run out of places to look. This