TextToDisplay Property

Microsoft PowerPoint Visual Basic

TextToDisplay Property

       

Returns or sets the display text for a hyperlink not associated with a graphic. Read/write 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 = "http://www.microsoft.com/"
    End With
End With