Update hyperlink

G

Gil

Hi,

I have a slide with hyperlinked rectangle.
I want to update the link with VBA.
I tried the following code.
It worked only when I choose the slide (using slide sorter).
I want to run it during presentation runtime (using command button).
What should I correct ?

Sub updateHyperlinks()

Dim s As Slide
Set s = ActivePresentation.Slides(2)

With s.Shapes("Rectangle 4")
With .ActionSettings(ppMouseClick).Hyperlink
.Address = ""
.SubAddress = "report slide"
.ScreenTip = ""
.TextToDisplay = ""
End With
End With

End Sub
 
D

David M. Marcovitz

It works for me in Slide Show view. How are you running it? I created a
shape and set the action settings to run the macro, and it worked
perfectly. I could then click on Rectangle 4 on slide 2 and it would go
to the slide with the title "report slide"

What is it not doing that you want it to do?

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
G

Gil

Hi David,

Thank you for your help.
I think that I found the problem.
I tried it again (as you did) and found that it added the new
hyperlink to the old one
(before running the Sub, Rectangle 4 was linked to external
presentation.
after running it it was linked to something like"report/
report.ppt#report slide").

I added a line to my code in order to delete the old hyperlink before
adding the new one and it worked.

Thank you
Gil D.
 

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