Launch a macro from animation sequence in PowerPoint 2007

  • Thread starter Thomas Preschel
  • Start date
T

Thomas Preschel

Hi,

Is there a way to launch a VBA macro from an animation sequence in
PowerPoint 2007 ?

Creating a custom animation effect with a CommandEffect behavior of type
msoAnimCommandTypeCall looks like it should do the trick, but the
documentation for this effect type in the MSDN library is poor and the
following doesn't work :

Dim shp As Shape
Dim seq As Sequence
Dim eff As Effect
Dim beh As AnimationBehavior
Set shp = findShape("TestShape")
Set seq = ActivePresentation.Slides(1).TimeLine.InteractiveSequences.Add(-1)
Set eff = seq.AddEffect(shp, msoAnimEffectCustom, msoAnimateLevelNone,
msoAnimTriggerOnShapeClick, -1)
Set beh = eff.Behaviors.Add(msoAnimTypeCommand, -1)
beh.CommandEffect.Type = msoAnimCommandTypeCall
beh.CommandEffect.Command = "TestSub()"

It is possible to launch a macro using the ActionSettings of a shape, but
not as part of an animation sequence. Interactive sequences are not triggered
in that case.

Launching a macro from the main animation sequence of the slide could also
help anyone who wants to run a macro automatically at the beginning of a
slide.

Thanks,
Thomas
 

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