February 25, 2021
Hot Topics:

Outlook 2000 VBA Programmers Reference

  • By Dwayne Gifford
  • Send Email »
  • More Articles »

Application Property

The Application property returns the Application object for the Folders collection. This will be the Outlook Application object.

Set ApplicationObject = FoldersCollection.Application

Class Property

The Class property returns a unique value that identifies an object’s type. This will be one of the OlObjectClass constants and in this case will be olFolders or 15.

Long = FoldersCollection.Class

Count Property

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

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.

Parent Property

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

Session Property

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

This article was originally published on November 20, 2002

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date