Hyperlink.Range property (Publisher)

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

Syntax

expression.Range

expression A variable that represents a Hyperlink object.

Remarks

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

Example

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"

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.