Hyperlink.TextToDisplay property (Publisher)

Returns or sets a String that represents the text displayed for a hyperlink. Read/write.

Syntax

expression.TextToDisplay

expression A variable that represents a Hyperlink object.

Return value

String

Example

This example sets the hyperlink display text and address of the first hyperlink on the first page. This example assumes that the first page of the active publication contains at least one shape with at least one text hyperlink.

Sub SetHyperlinkTextToDisplay() 
 With ActiveDocument.Pages(1).Shapes(1) _ 
 .TextFrame.TextRange.Hyperlinks.Item(1) 
 .TextToDisplay = "Tailspin Toys website" 
 .Address = "https://www.tailspintoys.com/" 
 End With 
End Sub

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.