Retrieve ActionSettings via VB

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I searched for this topic but didn't find exactly what I'm after ....

I have a presentation in which I would like to run a macro and use a MsgBox
to return the ActionSettings of a shape. For example, when NOT in a show, I
want to select a shape that has, say, a "Next Slide" action assigned to it,
or maybe it calls a macro.Then I will run a macro that tells me the
ActionSettings. How can I programmatically accomplish this? I can't seem to
find that property. I can get Name, etc.

Thanks!
 
Extend on this code:

' Action settings on mouse-click for the shape passed as argument.

Sub GetActionSetting(oShp As PowerPoint.Shape)
Select Case oShp.ActionSettings(ppMouseClick).Action
Case ppActionNone
'Enter code here
Case ppActionNextSlide
'Enter code here
Case ppActionPreviousSlide
'Enter code here
Case ppActionFirstSlide
'Enter code here
Case ppActionLastSlide
'Enter code here
Case ppActionLastSlideViewed
'Enter code here
Case ppActionEndShow
'Enter code here
Case ppActionHyperlink
'Enter code here
Case ppActionRunMacro
'Enter code here
Case ppActionRunProgram
'Enter code here
Case ppActionNamedSlideShow
'Enter code here
Case ppActionOLEVerb
'Enter code here
Case ppActionPlay
'Enter code here
Case Else
'Enter code here
End Select
End Sub
 
Shyam,

Thanks for your reply. I am having problems running this code. It does not
show up in my macro list unless the argument (oShp As PowerPoint.Shape) is
blanked.

What I want to know is if I click on a shape and it's Action Settings is to
go to Slide 10, I want this info posted in a message box when I run the
GetActionSetting macro.

for example:

MsgBox (ActiveWindow.Selection.ShapeRange.ActionSettings.Value)

or something that will tell me what slide it points to

However, this object is not supported in this manner.

Thanks!
 
Here's a variation on Shyam's theme that should work for you. It doesn't
check to make sure you have a shape selected, but it should work if you
do have one shape selected when you run the macro.

Sub GetActionSetting()
Dim oShp As Shape
Set oShp = ActiveWindow.Selection.ShapeRange(1)
Select Case oShp.ActionSettings(ppMouseClick).Action
Case ppActionNone
'Enter code here
Case ppActionNextSlide
'Enter code here
Case ppActionPreviousSlide
'Enter code here
Case ppActionFirstSlide
'Enter code here
Case ppActionLastSlide
'Enter code here
Case ppActionLastSlideViewed
'Enter code here
Case ppActionEndShow
'Enter code here
Case ppActionHyperlink
'Enter code here
Case ppActionRunMacro
'Enter code here
Case ppActionRunProgram
'Enter code here
Case ppActionNamedSlideShow
'Enter code here
Case ppActionOLEVerb
'Enter code here
Case ppActionPlay
'Enter code here
Case Else
'Enter code here
End Select
End Sub


--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
David,

Thanks, that code works well. However, it still does not tell me what the
action is. I want to know not only that the action is to run a macro, but the
name of the macro being run. Is that possible?
Such as:
MsgBox oShp.ActionSettings(ppMouseClick).Action.Value

Thanks !
 

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

Back
Top