Share via


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