Michael May
Michael May

Reputation: 61

How to apply a hyperlink to another slide in the document?

Is it possible to apply a hyperlink to another slide in the document using VBA?

I have a document that has labelled hyperlinks.
I right-click each one to assign a link which is taking a long time and open to me making mistakes.

Could a loop routine apply the appropriate hyperlinks?

Upvotes: 0

Views: 698

Answers (1)

John Korchok
John Korchok

Reputation: 4913

Here's a simple macro for setting the hyperlink to a slide in the same presentation:

Sub SetHyperlinkToSlide()
    With ActiveWindow.Selection.ShapeRange.ActionSettings(ppMouseClick).Hyperlink
        .Address = ""
        .SubAddress = "257,2,Title"
        .ScreenTip = ""
        .TextToDisplay = ""
    End With
End Sub

The 3 numbers in Subaddress are the SlideID, the SlideIndex and the SlideTitle parameters. You don't have to include all three, but you do have to include all the commas. So If you want to jump to a known slide title:

.SubAddress = ",,Known Slide Title"

Upvotes: 3

Related Questions