Share via


Hyperlinks Property [Publisher 2003 VBA Language Reference]

Returns a Hyperlinks collection representing all the hyperlinks in the specified text range.

expression.Hyperlinks

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

Example

The following example looks for all the shapes on page one of the active publication that have text frames and reports how many hyperlinks each shape has.

Dim hypAll As Hyperlinks
Dim shpLoop As Shape

For Each shpLoop In ActiveDocument.Pages(1).Shapes
    If shpLoop.HasTextFrame = msoTrue Then
        Set hypAll = shpLoop.TextFrame.TextRange.Hyperlinks
        Debug.Print "Shape " & shpLoop.Name _
            & " has " & hypAll.Count & " hyperlinks."
    End If
Next shpLoop

Applies to | TextRange Object