Folders Object

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.


Aa158703.parchild(en-us,office.10).gifFolders
Aa158703.space(en-us,office.10).gifAa158703.parchild(en-us,office.10).gif

An object containing MAPIFolder objects that represent all the available Microsoft Outlook folders in a specific subset at one level of the folder tree.

Using the Folders Object

Use the Folders property to return the Folders object 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.

  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.

  Set myNewFolder = myFolder.Folders(1)