Freigeben über


Visual Basic Extensibility Reference

Item Method (Add-Ins)

See Also   Example   Applies To

Returns an item from the specified collection by either name or index.

  • AddIns collection:

  • ContainedVBControls****collection:

  • Members collection:

  • SelectedVBControls****collection:

  • VBControls****collection:

  • VBNewProjects****collection:

Syntax

object**.Item(index)**

object**.Item(**collectionindex, [controlindex]) As VBControl

object**.Item(var) As Member**

The Item method syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
index Required. A variant expression specifying the name or index in the collection of the object to be accessed.
collectionindex Required. A numeric expression specifying the index
controlindex Optional.
var Required.

Remarks

There is no guarantee that a given index number for a collection will always point to the same item, because items may be added or deleted from the collection. Using index numbers for the collection is useful only when iterating through the whole collection and no items are added or deleted during the iteration.