finding oHl.Address for an action button?

G

Geoff Cox

Hello,

The code below looks at each slide and finds any action buttons (type
1/130) but I would like to display the contents of the Address and
SubAddress fields.

I know that I need oHl.Address and oHl.SubAddress but not clear how to
get this info for each action button found.

How would I do this?!

Thanks

Geoff


Sub check_for_hyperlinks(strMyFile As String)

Dim oPresentation As Presentation
Set oPresentation = Presentations.Open(strMyFile)

With oPresentation

Dim oSl As Slide

For Each oSl In ActivePresentation.Slides
Dim oSh As shape

For Each oSh In oSl.Shapes
If oSh.Type = 1 Then
If oSh.AutoShapeType = 130 Then
MsgBox "we have an action button"
End If
End If
Next oSh
Next oSl

oPresentation.Close
End With

Set oSh = Nothing
Set oPresentation = Nothing

End Sub
 
B

Bill Dilworth

The default action for the Next Slide action button is to advance to the
next slide (whatever the number of the next slide is). It does not care
where you are in the presentation, it just advances to the next slide. So,
the answer is Current location +1.

This will show you the address and sub-address of the NextSlide action
buttons on the second slide.

Sub OffTheCuff()
Dim oshp As Shape
For Each oshp In ActivePresentation.Slides(2).Shapes
If oshp.Type = 1 Then
If oshp.AutoShapeType = 130 Then
With oshp.ActionSettings(ppMouseClick).Hyperlink
MsgBox .Address & vbCr & .SubAddress
End With
End If
End If
Next oshp
End Sub


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
G

Geoff Cox

The default action for the Next Slide action button is to advance to the
next slide (whatever the number of the next slide is). It does not care
where you are in the presentation, it just advances to the next slide. So,
the answer is Current location +1.

This will show you the address and sub-address of the NextSlide action
buttons on the second slide.

Sub OffTheCuff()
Dim oshp As Shape
For Each oshp In ActivePresentation.Slides(2).Shapes
If oshp.Type = 1 Then
If oshp.AutoShapeType = 130 Then
With oshp.ActionSettings(ppMouseClick).Hyperlink
MsgBox .Address & vbCr & .SubAddress
End With
End If
End If
Next oshp
End Sub

Many thanks Bill.

Cheers

Geoff
 

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