Cloning animations in Visual Basic for PPT 2003

Cloning animations in Visual Basic for PPT 2003

Post by amts » Sun, 12 Nov 2006 14:43:03


I need to clone an animation from one shape to another in PowerPoint 2003. I
don't have $50 for "Animation Carbon". The clone method of the sequence
object should do this.

However, when I use this method, it does not clone the text animation
information. Here is a snippet of my code (prior to running the macro, the
user selects the shape whose animation he wants to clone and the shape he
wants to animate):

'Get the slide with the shapes
Set mySlide = ActiveWindow.Selection.SlideRange(1)
'Get the shape that has the animation to be copied
Set myShapeFrom = ActiveWindow.Selection.ShapeRange(1)
'Get the shape to be animated
Set myShapeTo = ActiveWindow.Selection.ShapeRange(2)

'Check each effect in the main sequence of the slide where the shapes were
'selected
For Each myEffFrom In mySlide.TimeLine.MainSequence
'Check if the shape attached to this effect is the shape whose
'animation is to be copied
If myEffFrom.Shape.Id = myShapeFrom.Id Then
'If it is, clone the effect and set the shape for this effect
'to the shape being animated
Set myEffTo = mySlide.TimeLine.MainSequence.Clone(myEffFrom)
Set myEffTo.Shape = myShapeTo
End If
Next myEffFrom

(same code for each interactive sequence)

If the shape being animated (i.e., myShapeTo) has text, only the text is
animated. When I look at the effect options (pulldown from effect in the
custom animation pane in ppt) there is no text animation tab.

I checked the parameters for each effect (original and cloned) and the only
one that doesn't match is the EffectInformation.AnimateBackground property.
This is true for the original effect and false for the cloned effect. The
AnimateBackground property is read only for the EffectInformation object.

So........ what am I overlooking? I'd truly appreaciate any help anyone can
give me.

Thanks,
 
 
 

Cloning animations in Visual Basic for PPT 2003

Post by Shyam Pill » Mon, 13 Nov 2006 01:24:09

Hi,
The approach you have taken is the easy way to clone a animation which will
work in many cases but will also fail in many cases too as you have
experienced. Take a look at the ConvertToAnimateBackground.

Regards,
Shyam Pillai

Image Importer Wizard
http://www.yqcomputer.com/