TextRange.Hyperlinks property (Publisher)
Returns a Hyperlinks collection representing all the hyperlinks in the specified text range.
Syntax
expression.Hyperlinks
expression A variable that represents a TextRange object.
Return value
Hyperlinks
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
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.