Need variable in hyperlink.subaddress (PP)
Need variable in hyperlink.subaddress (PP)
(OP)
Hi-
I'm trying to automatically insert a hyperlink into a text box based on what the text of the text box is. I am using PowerPoint.
What slide the text box links to can be linked based on the title of the slide. For instance, the title of the slide might be "John_Slide" while the text in the text box is "John." I want to be able to use the "John" to find "John_Slide".
I am able to extract what text is in the text box and assign it a variable. So say x = "John".
Now I want to insert a hyperlink based on the variable. The problem is the generic template of the hyperlink.subaddress looks like this,
ActiveWindow.Selection.SlideRange.Shapes("Text Box 4").Select
With ActiveWindow.Selection.ShapeRange.ActionSettings(ppMouseClick).Hyperlink
.Address = ""
.SubAddress = ",,Slide_Title"
.ScreenTip = ""
.TextToDisplay = ""
Where "Slide_Title" exists I want to put the equivalant of X & "_Slide", where X is the variable, in this case it would stand for "John" thus creating the slide title, "John_Slide."
With the quotes around the whole subaddress string, I don't know how to do this.
As usual, any insight would be greatly appreciated.
I'm trying to automatically insert a hyperlink into a text box based on what the text of the text box is. I am using PowerPoint.
What slide the text box links to can be linked based on the title of the slide. For instance, the title of the slide might be "John_Slide" while the text in the text box is "John." I want to be able to use the "John" to find "John_Slide".
I am able to extract what text is in the text box and assign it a variable. So say x = "John".
Now I want to insert a hyperlink based on the variable. The problem is the generic template of the hyperlink.subaddress looks like this,
ActiveWindow.Selection.SlideRange.Shapes("Text Box 4").Select
With ActiveWindow.Selection.ShapeRange.ActionSettings(ppMouseClick).Hyperlink
.Address = ""
.SubAddress = ",,Slide_Title"
.ScreenTip = ""
.TextToDisplay = ""
Where "Slide_Title" exists I want to put the equivalant of X & "_Slide", where X is the variable, in this case it would stand for "John" thus creating the slide title, "John_Slide."
With the quotes around the whole subaddress string, I don't know how to do this.
As usual, any insight would be greatly appreciated.





RE: Need variable in hyperlink.subaddress (PP)
CODE
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting
Steam Engine enthusiasts: www.essexsteam.co.uk
RE: Need variable in hyperlink.subaddress (PP)
With ActiveWindow.Selection.ShapeRange.ActionSettings(ppMouseClick).Hyperlink
.Address = ""
'.SubAddress = ",3,"
.SubAddress = ",,John_Slide"
.TextToDisplay = ""
End With
.. and for the hyperlink, it inserts the following, "#,,Tom_Slide", and it is in the section for "Existing file or web page."
By "slide title" I mean the text box where it says "Click to Add Title." When I insert the hyperlink manually, it does say the slide title I added, e.g. John_Slide.
I looked through the book I have on VBA in the section on PP, but I found very little and my internet searches are not proving fruitful. It seems like I am missing something very minor .....
RE: Need variable in hyperlink.subaddress (PP)
... sorry I meant to say John_Slide, but the principle still applies.
RE: Need variable in hyperlink.subaddress (PP)
"It's failing because when you call the link, you're calling an empty link. The only info you have is slide title.
",,Tom_Slide"
An empty link location is the same as a link to "#" (that's why the link is displaying as #). You're getting errors because the code is saying "linking to an empty location with the title "Tom_Slide". You need variables for where the empty spaces are. You can't just use the slide title as the way to link. You have to use the slide ID and slide index."
Can you really not find something by slide title? That seems a little weird to me - why even have it?
I will continue to find some other way to reference the slides.
RE: Need variable in hyperlink.subaddress (PP)
Microsoftcom's link on hyperlink.subaddress
http://ms
I have a problem with the direction on here though, it says,
"This example sets shape one on slide one in the active presentation to jump to the slide named "Last Quarter" in Latest Figures.ppt when the shape is clicked during a slide show."
This suggests to me that it is the NAME of the slide that you need to reference. But I just played around with it and it very definitely wants to find a slide title, not the name of the slide.
I did not type in the .address as suggested on the tutorial because this pp pressie is going to be uploaded to a different website and I want the link to go to a spot inside the pressie regardless where it is located. I hope that actually works ....