Item Method
Home Page (Objects) | Overview | FAQ | Reference
Applies to: Breakpoints object, Configurations object, Documents object, Projects object, Windows object
Gets a specified breakpoint, configuration, document, project, or window from a collection.
Syntax
object**.Item** [index]
-or-
objectindex
Parameters
object
An expression that evaluates to one of the objects in the Applies To list above.
index
A Variant that is a Long or String representing the appropriate breakpoint, configuration, document, project, or window.
If you specify a Long, the Item method fetches the object by its one-based index in the collection.
If you specify a String, it must be one of the strings described in the following table:
Object | String |
Configuration | The configuration's name (as defined by the Name property). |
Document | The document's file name (as defined by the Type property).
For the file name, specify the full path to the file. If you specify only the file name, Developer Studio tries to find an open document with that name. However, if more than one open document has that name, the Item method gets the document from the current directory. If none of the open documents are in the current directory, the Item method chooses one arbitrarily. If you specify a relative path, Developer Studio bases the path on the current directory. |
Project | The project's name (as defined by the Name property). |
Window | The window's caption (as defined by the Caption property). |
Remarks
If you specify numbers for index, do not store these for later use because the indices might change as documents or windows are added or removed.
The Item method is the default. Accordingly, you don't have to reference Item explicitly, as shown in the syntax.
Example
The following example prints all open documents:
Sub PrintAllOpenDocuments( )
for num = 1 to Documents.Count
Documents(num).PrintOut
next
End Sub