Manipulating Folders and Items

Folders in Outlook are represented by the MAPIFolder object. You can obtain a reference to the default folder for a built-in Outlook item by using the NameSpace object's GetDefaultFolder method. The syntax is

						obj.GetDefaultFolder(itemtype)

Obj is a reference to the NameSpace object, and item is a constant identifying the type of item whose default folder you want to retrieve. Possible settings for this argument are described in Table 10.1.

Table 10.1. Constants for the GetDefaultFolder method's itemtype argument.
ConstantItem
OlFolderCalendarCalendar
OlFolderContactsContacts (the address book)
OlFolderDeletedItemsItems that have been deleted
OlFolderDraftsDrafts of incompleted items
OlFolderInboxReceived e-mail messages ...

Get Office® XP Development with VBA 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.