Outlook 2000 VBA Programmers Reference
The Application property returns the Application object for the Folders collection. This will be the Outlook Application object.
Set ApplicationObject = FoldersCollection.Application
The Class property returns a unique value that identifies an objects type. This will be one of the OlObjectClass constants and in this case will be olFolders or 15.
Long = FoldersCollection.Class
The Count property returns a long integer representing the number of MAPIFolder objects in the collection.
Long = FoldersCollection.Count
Dim onMAPI As NameSpace Dim ofcPersonalFolders As Folders Dim ofFolder As MAPIFolder Dim iFor As Integer Set onMAPI = Application.GetNamespace("MAPI") Set ofcPersonalFolders = onMAPI.Folders.Item("Mailbox Dwayne Gifford").Folders For iFor = 1 To ofcPersonalFolders.Count Set ofFolder = ofcPersonalFolders.Item(iFor) MsgBox ofFolder.Name Next
In this example a reference is set to the Folders collection of the Mailbox Dwayne Gifford folder. The Count property is then used to set the upper limit of the For Next construct, which is used to display the name of each of the folders within the collection.
The Parent property returns the parent object of the Folders collection. This we either be the NameSpace object or a MAPIFolder object.
Set MAPIFolderObject= FoldersCollection.Parent
The Session property returns the NameSpace object for the current collection. You should already have this object if you have a reference to a Folders collection.
Set NameSpaceObject = FoldersCollection.Session
Page 3 of 6