G
Geoff Cox
Hello,
The code below finds hyperlinks and the intention is that the linked
shape should be selected. The code works for the first slide but then
comes up with an error.
I imagine that the line following is wrong but I'm not clear why..
ActiveWindow.Selection.SlideRange.Shapes(oHl.Parent.Parent.Name).Select
Thanks
Geoff
Sub ShowMeTheHyperlinksSelectThemToo()
' Lists the slide number, shape name and address
' of each hyperlink
Dim oSl As Slide
Dim oHl As Hyperlink
For Each oSl In ActivePresentation.Slides
For Each oHl In oSl.Hyperlinks
If oHl.Type = msoHyperlinkShape Then
ActiveWindow.Selection.SlideRange.Shapes _
(oHl.Parent.Parent.Name).Select
MsgBox "HYPERLINK IN SHAPE" & vbCrLf & _
"Slide: " & vbTab & oSl.SlideIndex & vbCrLf _
& "Shape: " & oHl.Parent.Parent.Name & vbCrLf _
& "Address:" & vbTab & oHl.Address & vbCrLf & _
"SubAddress:" & vbTab & oHl.SubAddress
Else
' it's text
ActiveWindow.Selection.SlideRange. -
Shapes(oHl.Parent.Parent.Parent.Parent.Name).Select
MsgBox "HYPERLINK IN TEXT" _
& vbCrLf & "Slide: " & vbTab & oSl.SlideIndex & _
vbCrLf & "Shape: " & _
oHl.Parent.Parent.Parent.Parent.Name _
& vbCrLf & "Address:" & vbTab & oHl.Address & _
vbCrLf & "SubAddress:" & vbTab & oHl.SubAddress
End If
Next ' hyperlink
Next ' Slide
End Sub
The code below finds hyperlinks and the intention is that the linked
shape should be selected. The code works for the first slide but then
comes up with an error.
I imagine that the line following is wrong but I'm not clear why..
ActiveWindow.Selection.SlideRange.Shapes(oHl.Parent.Parent.Name).Select
Thanks
Geoff
Sub ShowMeTheHyperlinksSelectThemToo()
' Lists the slide number, shape name and address
' of each hyperlink
Dim oSl As Slide
Dim oHl As Hyperlink
For Each oSl In ActivePresentation.Slides
For Each oHl In oSl.Hyperlinks
If oHl.Type = msoHyperlinkShape Then
ActiveWindow.Selection.SlideRange.Shapes _
(oHl.Parent.Parent.Name).Select
MsgBox "HYPERLINK IN SHAPE" & vbCrLf & _
"Slide: " & vbTab & oSl.SlideIndex & vbCrLf _
& "Shape: " & oHl.Parent.Parent.Name & vbCrLf _
& "Address:" & vbTab & oHl.Address & vbCrLf & _
"SubAddress:" & vbTab & oHl.SubAddress
Else
' it's text
ActiveWindow.Selection.SlideRange. -
Shapes(oHl.Parent.Parent.Parent.Parent.Name).Select
MsgBox "HYPERLINK IN TEXT" _
& vbCrLf & "Slide: " & vbTab & oSl.SlideIndex & _
vbCrLf & "Shape: " & _
oHl.Parent.Parent.Parent.Parent.Name _
& vbCrLf & "Address:" & vbTab & oHl.Address & _
vbCrLf & "SubAddress:" & vbTab & oHl.SubAddress
End If
Next ' hyperlink
Next ' Slide
End Sub