Item Method

Microsoft Publisher Visual Basic

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.

ShowItem 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.

ShowItem 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.

ShowItem 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.

ShowItem 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

ShowAs 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
				

ShowAs 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)
				

ShowAs 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)
				

ShowAs 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)
				

ShowAs 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)
				

ShowAs 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")
				

ShowAs 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")