Hyperlink.TextToDisplay property (PowerPoint)

Returns or sets the display text for a hyperlink not associated with a graphic. Read/write.

Syntax

expression.TextToDisplay

expression A variable that represents a Hyperlink object.

Return value

String

Remarks

This property will cause a run-time error if used with a hyperlink that is not associated with a text range. Use code similar to the following to test whether or not a given hyperlink, represented here by myHyperlink, is associated with a text range.

If TypeName(myHyperlink.Parent.Parent) = "TextRange" Then
    strTRtest = "True"
End If

Example

This example creates an associated hyperlink with the text in shape two on slide one. It then sets the display text to "Microsoft Home Page" and sets the hyperlink address to the correct URL.

With ActivePresentation.Slides(1).Shapes(2) _
        .TextFrame.TextRange
    With .ActionSettings(ppMouseClick)
        .Action = ppActionHyperlink
        .Hyperlink.TextToDisplay = "Microsoft Home Page"
        .Hyperlink.Address = "https://www.microsoft.com/"
    End With
End With

See also

Hyperlink Object

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.