O
Oliver Snow
Hello,
can somebody please point out the error in my thinking (or the error in PP2007)?
I am trying to add multiple hyperlinks to text in a shape on a slide in PowerPoint. The idea is to create a single slide with quick links to all the other slides, based on their titles).
I have some code which scans all the slide titles and successfully adds many shapes, each with text and ONE hyperlink per title to my slide, eg
Set tb = oSld.Shapes.AddTextbox(msoTextOrientationHorizontal,50,50,500,200)
Dim tb as Shape
With tb.TextFrame.TextRange
.text = SlideTitleText
end with
with tb.ActionSettings(ppMouseClick)
.Action = ppActionHyperlink
.Hyperlink.Address = SlideNumber
.Hyperlink.SubAddress = SlideTitleText
End With
But this leaves me with a whole lot of shapes and positioning them to avoid overlaps is painful. So I'd prefer a single shape with all the text in it.
Using the Powerpoint application itself, it is easy to add different hyperlinks to individual words in a shape's text.
However, the following does NOT work in VBA:
when I iterate over my collection of slide titles and place the strings all into a single shape's text, and then assign hyperlinks using
'(where a is the begining position and b the end position of the text being added...)
with.tb.TextFrame.TextRange.Characters(a,b).ActionSettings(ppMouseClick)
.Action = ppActionHyperlink
.Hyperlink.Address = SlideNumber
.Hyperlink.SubAddress = SlideTitleText
end with
The result is that only the last slide title in the shape's text has a hyperlink associated with it.
So I guess there is a flaw in my logic somewhere... Somehow, when I do this in VBA, the program is wiping out all the previous hyperlinks and only leaving the most recently added link (correctly linked to only the last string added to the shape, not to the rest of the texts).
Any ideas?
Thanks,
Oliver
Submitted via EggHeadCafe - Software Developer Portal of Choice
GOT INTERFACE?
http://www.eggheadcafe.com/tutorials/aspnet/35c59ac7-0594-4f40-8767-d64c223339e7/got-interface.aspx
can somebody please point out the error in my thinking (or the error in PP2007)?
I am trying to add multiple hyperlinks to text in a shape on a slide in PowerPoint. The idea is to create a single slide with quick links to all the other slides, based on their titles).
I have some code which scans all the slide titles and successfully adds many shapes, each with text and ONE hyperlink per title to my slide, eg
Set tb = oSld.Shapes.AddTextbox(msoTextOrientationHorizontal,50,50,500,200)
Dim tb as Shape
With tb.TextFrame.TextRange
.text = SlideTitleText
end with
with tb.ActionSettings(ppMouseClick)
.Action = ppActionHyperlink
.Hyperlink.Address = SlideNumber
.Hyperlink.SubAddress = SlideTitleText
End With
But this leaves me with a whole lot of shapes and positioning them to avoid overlaps is painful. So I'd prefer a single shape with all the text in it.
Using the Powerpoint application itself, it is easy to add different hyperlinks to individual words in a shape's text.
However, the following does NOT work in VBA:
when I iterate over my collection of slide titles and place the strings all into a single shape's text, and then assign hyperlinks using
'(where a is the begining position and b the end position of the text being added...)
with.tb.TextFrame.TextRange.Characters(a,b).ActionSettings(ppMouseClick)
.Action = ppActionHyperlink
.Hyperlink.Address = SlideNumber
.Hyperlink.SubAddress = SlideTitleText
end with
The result is that only the last slide title in the shape's text has a hyperlink associated with it.
So I guess there is a flaw in my logic somewhere... Somehow, when I do this in VBA, the program is wiping out all the previous hyperlinks and only leaving the most recently added link (correctly linked to only the last string added to the shape, not to the rest of the texts).
Any ideas?
Thanks,
Oliver
Submitted via EggHeadCafe - Software Developer Portal of Choice
GOT INTERFACE?
http://www.eggheadcafe.com/tutorials/aspnet/35c59ac7-0594-4f40-8767-d64c223339e7/got-interface.aspx