Item Method (General Extensibility)
Returns an indexed member of a collection.
Public Function Item( _ ByVal index As Object _ ) As AddIn
Function Item( _ ByVal index As Variant _ ) As AddIn
HRESULT __stdcall Item( VARIANT index, /* [out, retval] */ AddIn** retVal );
public AddIn Item( object index );
public function Item( index : Object ) : AddIn
Parameters
- Index
- Required. The index of the item to return.
Remarks
For most objects, the value passed to Index is an integer that is an index to an object in its collection, such as OutputWindowPanes.Item(4), which equates to an OutputWindow object in the collection. For many objects, though, the value of Index can also be a string value that equates to an object in the collection. For example, if you have an Output window called "My Output Window," rather than referring to it by its index value, you could instead refer to it by its name, such as OutputWindowPanes.Item("My Output Window"). The exact value that is accepted by Item, though, depends upon the collection and its implementation.
Example
Sub ItemExample1()
' Closes all saved documents.
Dim iDoc As Integer
For iDoc = 1 To DTE.Documents.Count
If DTE.Documents.Item(iDoc).Saved Then
DTE.Documents.Item(iDoc).Close()
End If
Next iDoc
End Sub
See Also
Applies To: AddIns Collection | Breakpoints Collection | BuildDependencies Collection | CodeElements Collection | Configurations Collection | ContextAttributes Collection | Documents Collection | Expressions Collection | FontsAndColorsItems Collection | Imports Object | IVCCollection Collection | Languages Collection | LinkedWindows Collection | OutputGroups Collection | OutputWindowPanes Collection | Processes Collection | Programs Collection | ProjectItems Collection | Projects Collection | Properties Collection | References Object | SelectedItems Collection | SelectionContainer Object | Solution Object | SolutionConfigurations Collection | SolutionContexts Collection | StackFrames Collection | TaskItems Collection | TextPanes Collection | TextRanges Collection | Threads Collection | ToolBoxItems Collection | ToolBoxTabs Collection | UIHierarchyItems Collection | VCCodeElements Collection | WindowConfigurations Collection | Windows Collection