Item Method

See Also         Example         Applies To

Returns a member of a collection, either by position or by name.

Syntax

expression.Item(Index)

expression   Required. An expression that returns an object in the Applies To list.

Index   Required Variant. The name or index number of a member of the collection. The index can be a numeric expression (a number from 1 to the value of the collection's Count property), a constant, or a string. For more information about using the Item method with a specific collection, see the Help topic for that collection.

Remarks

If the value provided as Index doesn't match any existing member of the collection, an error occurs.

The Item method is the default method for collections. Therefore, the following two lines of code are equivalent.

Application.Documents(1)
Application.Documents.Item(1)