Table of contents
TOC
Collapse the table of content
Expand the table of content

TextRange.Hyperlinks Property (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

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
© 2018 Microsoft