The Folders collection represents the available folders at any given level of the
folder hierarchy. The concept of the Folders collection is recursive in nature, meaning
that you can have as many levels of folders as you want. The screenshot below shows a
typical folder hierarchy indicating the different folder levels.
You can see that the Mailbox Dwayne Gifford Folders collection contains a number
of individual Folder objects, Calendar, Contacts, etc. Each folder can contain Outlook
items and MAPIFolders.
The various properties, methods and events of the Folders collection and Folder object
allow navigation to and manipulation of these folders and the items that they contain.
There are two ways to get a reference to a Folders collection. The first is through the
NameSpace object. This will return the root Folders collection
Syntax:
Dim ofcFolders as Folders
Dim onMAPI as NameSpace
Set ofcFolders = onMAPI.Folders
The second is from a MAPIFolder object. This will return the Folders collection
representing all folders contained by the specified MAPIFolder.
Dim ofcFolders as Folders
Dim ofFolder as MAPIFolder
Set ofcFolders = ofFolder.Folders
For example if we choose the Notes folder to be the MAPIFolder then the ofcFolders
collection would contain all folders starting Level 2.
Add www.developer.com to your favorites Add www.developer.com to your browser search box IE 7 | Firefox 2.0 | Firefox 1.5.xReceive news via our XML/RSS feed