Share via


Range Property [Publisher 2003 VBA Language Reference]

Range property as it applies to the InlineShapes collection.

Returns a ShapeRange collection representing the same set of inline shapes as the InlineShapes collection whose method was called. This allows for miscellaneous formatting of the contained shapes. Read-only.

expression.Range(Index)

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

Index  Optional Long. The index position of the inline shape within the ShapeRange.

Returns a TextRange object representing the base text to which the specified hyperlink has been applied.

expression.Range

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

Remarks

If the Type property of the specified Hyperlink object is a value other than msoHyperlinkRange, the Range property returns nothing.

Example

As it applies to the InlineShapes collection.

The following example searches through each shape on the first page of the publication, and for all inline shapes within each shape, finds the first inline shape within the range of inline shapes and flips it vertically.

Dim theShape As Shape
Dim theShapes As Shapes

Set theShapes = ActiveDocument.Pages(1).Shapes

For Each theShape In theShapes
    With theShape.TextFrame.TextRange
        .InlineShapes.Range(1).Flip (msoFlipVertical)
    End With
Next

The following example returns the text range associated with the first hyperlink on page one of the active publication and changes the base text to "Go here."

Dim txtHyperlink As TextRange

txtHyperlink = ActiveDocument.Pages(1) _
    .Shapes(1).Hyperlink.Range

txtHyperlink.Text = "Go here"

Applies to | Hyperlink Object | InlineShapes Collection