Partager via


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. You can 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

Concepts

Hyperlink Object Members

Hyperlink Object