How to change a hyperlink address on a slide

J

JPW

Here is my code. The hyperlink will not update to the new address

Public Sub ChangeHyperlinkAddress()
'declare variables and assign address to object variable
Dim sldSecond As Slide
Dim hypTemp As Hyperlink
Dim strAddress As String

Set sldSecond = Application.Presentations("WhitakerJT9P9.pptm").Slides(2)

'enter new hyperlink address
strAddress = InputBox("Enter hyperlink address", "Hyperlink Address")


'change address of hyperlinks on second slide
For Each hypTemp In sldSecond.Hyperlinks
hypTemp.Address = strAddress
Next hypTemp

'select the second slide
Application.SlideShowWindows(1).View.Next

End Sub
 
J

John Wilson

Are you running this macro during a slide show? Maybe you could explain why
you need to do this.

As far as I can see the macro should work though assuming that the target
presentation is the active show.

Note that SlideShowWindows(1).View.Next does not necessarily take you to the
next slide but to the next build

..View.GoToSlide(2) might work better

--
-------------------------------------------
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
 
J

JPW

This was a homework assignment for a VBA class. This works in 2003, but the
class is for 2007. Yes, I was running an action macro in slide show view. I
have already submitted my homework, but would still like to know how to do
this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top