Compartir a través de


Visual Basic Extensibility Reference

Item Method (VBA Add-In Object Model)

See Also   Example   Applies To   Specifics

Returns the indexed member of a collection.

Syntax

object**.Item(index)**

The Item method syntax has these parts:

Part Description
object Required. An object expression that evaluates to an object in the Applies To list.
index Required. An expression that specifies the position of a member of the collection. If a numeric expression, index must be a number from 1 to the value of the collection's Count property. If a string expression, index must correspond to the key argument specified when the member was added to the collection.

The following table lists the collections and their corresponding key arguments for use with the Item method. The string you pass to the Item method must match the collection's key argument.

Collection Key argument
Windows Caption property setting
LinkedWindows Caption property setting
CodePanes No unique string is associated with this collection.
VBProjects Name property setting
VBComponents Name property setting
References Name property setting
Properties Name property setting

Remarks

The index argument can be a numeric value or a string containing the title of the object.