Item Method [Publisher 2003 VBA Language Reference]

Item method as it applies to the InlineShapes collection.

Returns a Shape object that represents an inline shape contained in a text range. This method is the default member of the InlineShapes collection.

expression.Item(Index)

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

Index  Required Variant. The index position or name of the object to return. If Index is an integer, the index into the collection is 1-based. If Index is a string, the name of the shape is used as the index. An automation error is returned if the index or name does not represent a shape in the collection.

Item method as it applies to the MailMergeDataFields object.

Returns a MailMergeDataField object from the specified MailMergeDataFields object.

expression.Item(varIndex)

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

varIndex  Required Variant. The number or name of the field to return.

Item method as it applies to the CellRange, Columns, Fields, MailMergeFilters, ObjectVerbs, Rows, Stories, and TabStops objects.

Returns an individual object in a specified collection.

expression.Item(Index)

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

Index  Required Long. The number of the object to return.

Item method as it applies to the WebHiddenFields and WebListBoxItems objects.

Returns a String corresponding to the value of a hidden field in a Web form or a list item in a Web list box control.

expression.Item(Index)

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

Index  Required Variant. The number or name of the field or list box item to return.

Item method as it applies to all the other objects in the Applies To list.

Returns an individual object in a specified collection.

expression.Item(Index)

expression Required. An expression that returns one of the objects in the Applies To list.

Index  Required Variant. The number or name of the field or list box item to return.

Example

As it applies to the InlineShapes collection.

This example finds the first inline shape in a text range and flips it vertically.

Dim theShape As Shape

Set theShape = ActiveDocument.Pages(1).Shapes(1)

With theShape.TextFrame.Story.TextRange
    With .InlineShapes.Item(1)
        .Flip (msoFlipVertical)
    End With
End With

As it applies to the CellRange object.

This example returns the first cell from a CellRange object.

Dim cllTemp As Cell

Set cllTemp = ActiveDocument.Pages(Index:=1) _
    .Shapes(1).Table.Cells.Item(Index:=1)

As it applies to the Columns object.

This example returns the first column from a Columns object.

Dim colTemp As Column

Set colTemp = ActiveDocument.Pages(Index:=1) _
    .Shapes(1).Table.Columns.Item(Index:=1)

As it applies to the Fields object.

This example returns the first field from a Fields object.

Dim fldTemp As Field

Set fldTemp = ActiveDocument.Pages(Index:=1) _
    .Shapes(1).TextFrame.TextRange.Fields.Item(Index:=1)

As it applies to the GroupShapes, ShapeRange, and Shapes object.

This example returns the first shape inside a grouped shape.

Dim shpTemp As Shape

Set shpTemp = ActiveDocument.Pages(Index:=1) _
    .Shapes(1).GroupItems.Item(Index:=1)

As it applies to the MailMergeMappedDataFields object.

This example returns the "City" field from a mapped data fields object.

Dim mmfTemp As MailMergeMappedDataField

Set mmfTemp = ActiveDocument.MailMerge _
    .DataSource.MappedDataFields.Item(Index:="City")

As it applies to the TextStyles object.

This example returns the "Normal" text style from the active publication.

Dim txtStyle As TextStyle

Set txtStyle = ActiveDocument.TextStyles.Item(Index:="Normal")

Applies to | BorderArts Collection | CatalogMergeShapes Collection | CellRange Collection | Columns Collection | Fields Collection | GroupShapes Collection | InlineShapes Collection | MailMergeDataFields Collection | MailMergeFilters Collection | MailMergeMappedDataFields Collection | ObjectVerbs Collection | Rows Collection | ShapeNodes Collection | ShapeRange Collection | Shapes Collection | Stories Collection | TabStops Collection | Tags Collection | TextStyles Collection | WebHiddenFields Collection | WebListBoxItems Object | WebNavigationBarHyperlinks Object | WebNavigationBarSets Collection