Item Method

Microsoft Office Object Model

Show All

Item Method

       

Item method as it applies to the COMAddIns object.

Returns a member of the specified COMAddIns collection.

expression.Item(Index)

expression   Required. The specified COMAddIns collection.

Index  Required Variant. Either an ordinal value that returns the COM add-in at that position in the COMAddIns collection, or a String value that represents the ProgID of the specified COM add-in.

Item method as it applies to the FileDialogFilters object.

Returns a FileDialogFilter object that is a member of the specified FileDialogFilters collection.

expression.Item(Index)

expression   Required. An expression that returns one of the above objects.

Index  Required Long. The index number of the FileDialogFilter object to be returned.

Item method as it applies to the HTMLProjectItems object.

Returns the HTMLProjectItem object that represents a particular project in the Microsoft Script Editor.

expression.Item(Index)

expression   Required. An HTMLProjectItems collection.

Index  Required Variant. The name or index number of the HTML project item to be returned.

Item method as it applies to the Scripts object.

Returns a member of the Scripts collection. Accepts the index number or ID of the script you want the Microsoft Office application to return. The Item method accepts a Variant value that can accept either an ordinal number (index value), which returns the script stored at that position in the Scripts collection, or a String value that represents the name or ID of the script.

expression.Item(Index)

expression   Required. An expression that returns a Scripts object.

Index  Required Variant. The ID or index number of the script to be returned.

Remarks

The Scripts collection contains all of the scripts in a given document, in source order (the order in which Script objects appear in the source file). Scripts are maintained in source order regardless of their location in the document—that is, whether they’re in the header or the body text.

You can use the Item method to access a script in the Scripts collection by using the ID of the <SCRIPT> tag. The ID attribute of the <SCRIPT> tag is identical to the Id property of the Script object. If there are duplicate or multiple IDs in the document and you use the Id property of a Script object to access a script by using the Item method, Office returns the first script that matches the ID; additional scripts with the same ID are ignored.

New script anchors added to the collection are appended to the end of the Scripts collection in the order in which they were added to the document. The script anchors remain in this order until the document is saved as HTML, closed, and then opened again in the host application. Following these steps causes the Scripts collection to be indexed in the order in which the script anchors appear in the document, which may be different than the order in which they were added to it. Therefore, you’re advised to use the Id property of the Script object, rather than the script’s position in the collection, to ensure positive identification of the script.

Item method as it applies to the FileDialogSelectedItems object.

Returns a String that corresponds to the path of one of the files that the user selected from a file dialog box that was displayed using the Show method of the FileDialog object. The FileDialogSelectedItems collection is a collection of strings.

expression.Item(Index)

expression   Required. An expression that returns one of the above objects.

Index  Required Long. The index number of  the string to be returned.