Folders.Item Method

Outlook Developer Reference

Returns a Folder object from the collection.

Syntax

expression.Item(Index)

expression   A variable that represents a Folders object.

Parameters

Name Required/Optional Data Type Description
Index Required Variant Either the index number of the object, or a value used to match the default property of an object in the collection.

Return Value
A Folder object that represents the specified object.

Example

The following example adds the public folder Internal to the user's Favorites folder by using the AddToPFFavorites method.

Visual Basic for Applications
  Sub AddToFavorites()
    'Adds a Public Folder to the List of favorites
    Dim objFolder As Outlook.Folder
    Set objFolder = Application.Session.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders.Item("GroupDiscussion").Folders.Item("Standards").Folders.Item("Internal")
    objFolder.AddToPFFavorites
End Sub

See Also