Item Method [Outlook 2007 Developer Reference]

Switch View :
ScriptFree
Folders.Item Method
Returns a Folder object from the collection.

Syntax

expression.Item(Index)

expression   A variable that represents a Folders object.

Parameters

NameRequired/OptionalData TypeDescription
IndexRequiredVariantEither 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