Folders Collection Object

Folders Collection Object

See Also         Properties         Methods         Events

Multiple objects
Folders collection (MAPIFolder object)
Multiple objects

A collection of MAPIFolder objects that represent all the available Outlook folders in a specific subset at one level of the folder tree.

Using the Folders Collection

Use the Folders property to return the Folders collection from a NameSpace object or another MAPIFolder object.

Use Folders(index), where index is the name or index number, to return a single MAPIFolder object. Folder names are case-sensitive.

The following Visual Basic for Applications example returns the folder named "Old Contacts" from myFolder

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNameSpace("MAPI")
Set myFolder = _
    myNameSpace.GetDefaultFolder(olFolderContacts)
Set myNewFolder = myFolder.Folders("Old Contacts")

The following Visual Basic for Applications example returns the first folder in myFolder.

Set myNewFolder = myFolder.Folders(1)