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
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