Share via


Animating Shapes in PowerPoint 2000 and 97 (Part 1)

So, while I was out of town, my first article dealing with PowerPoint animation made its debut:

Comparing Ways to Control Animation in PowerPoint 2002 and 2003

As I’ve mentioned in previous blog entries, there are actually two ways to programmatically animate shapes on a slide: one that works best for PowerPoint 2002 and 2003, and one that’s been retained for compatibility with PowerPoint 2000 and 97. This article examines the differences between the two, and discusses when using each is appropriate.

Slated for publication next week is the first of a two-part article that covers how to use the revised and greatly expanded animation functionality included in PowerPoint 2002 and 2003.

Now, while my articles naturally focus on the advantages of using the 2002 and 2003 functionality, in order to write these articles I had to learn how to use the 2000 and 97 functionality as well. And since there’s a large number of developers out there still working with those versions, it seems worthwhile to take a few minutes and present that information here. So for the next few days, I’ll be covering how to animate shapes using the AnimationSettings object.

Applies to:

    Microsoft PowerPoint 2000

    Microsoft PowerPoint 97

Introduction

In PowerPoint, the term animations refers to special visual or sound effects you add to text or an object. Animation effects give motion to text, pictures, and other content on your slides. Besides adding action, they help you guide audience focus, emphasize important points, transition between slides, and maximize slide space by moving things on and off.

These effects can include how the shape (or its component parts) enter the slide, what the shape does once it appears on the slide, and how it appears once the animation sequence moves to the next shape. You can set the animation sequence to advance to the next animation effect by the user clicking on the slide, or pre-set timing settings.

Important If you are programming for PowerPoint versions 2002 or 2003, you should be using the TimeLine object model for dealing with animation effects; the AnimationSettings object model should only be used for PowerPoint versions 2000 and 97. The two object models are not compatible. Using the AnimationSettings object model for programming PowerPoint 2002 or 2003 is not recommended, as it can have unexpected and undesirable results for your animation sequences. For more information see Comparing Ways to Control Animation in PowerPoint 2002 and 2003.

Animations in PowerPoint 2000 and 97

In PowerPoint 2000 and 97, each Shape object on a slide can have a single animation effect, represented by that Shape object’s AnimationSettings object. You create and customize animations using the AnimationSettings object’s members and child objects. While each Shape object can have only one animation effect, in the case of charts or text, the animation effect may be a build effect, in which sub-objects of the shape are animated sequentially so that they combine, or build, to display the complete shape. We discuss build effect animations is greater detail later.

Shapes that are not animated appear on the slide when it first loads.

The individual animation effects for each shape collectively make up a slide’s animation sequence. There is one animation sequence per slide, and it starts when the slide loads.

Setting the Type, Timing, and Order of a Slide’s Animation Sequence

When you decide to add animation effects to a slide, the general questions you need to answer concern the sequence and timing of the shapes you want to animate:

· Which shapes do you want to animate?

· What kind of animation do you want PowerPoint to perform on each shape?

· In what order do you want PowerPoint to animate the shapes?

· How do you want to initiate each shape’s animation effect?

Setting Which Shapes Get Animated

For PowerPoint to animate a shape, you set the Animate property of its AnimationSettings object to msoTrue. PowerPoint automatically sets the Animate property to msoTrue in either of the following instances:

· You set the TextLevelEffect property to a value other than ppAnimateLevelNone.

· You set the EntryEffect property to a value other than ppEntryEffectNone.

The converse is also true. PowerPoint automatically sets the Animate property to msoFalse if you set the TextLevelEffect property to ppAnimateLevelNone, or set the EntryEffect property to ppEntryEffectNone.

Even if you have set other properties of the AnimationSettings object, PowerPoint disregards them and does not animate the shape unless the Animate property is set to msoTrue.

Shapes with an EntryEffect property of ppEffectNone are visible when the slide loads.

There are instances when you would want to set the EntryEffect property to ppEffectNone. For example, you could have a media object you want visible on the slide when it loads, even if you do not want to play the file until the fourth animation in the sequence. The following code does just that. Note that the code explicitly sets the Animate property is to True after it specifies the EntryEffect property as ppEffectNone.

With ActivePresentation.Slides(1).Shapes

 

    Set objShape = .Item("Title")

        With objShape.AnimationSettings

            .EntryEffect = ppEffectBlindsHorizontal

            .AnimationOrder = 1

        End With

    Set objShape = .Item("Shape1")

        With objShape.AnimationSettings

            .EntryEffect = ppEffectFlyFromLeft

            .AnimationOrder = 2

        End With

    Set objShape = .Item("MovieClip")

        With objShape.AnimationSettings

            .EntryEffect = ppEffectNone

            .Animate = msoTrue

            .AnimationOrder = 3

        End With

End With

Specifying the Animation Effect PowerPoint Performs on a Shape

Use the EntryEffect property to specify which animation effect you want PowerPoint to perform on the selected shape. All animation effects created using the AnimationSettings object are entrance effects. Entrance effects are animations that control how the shape becomes visible on the slide. For example, this could involve having the shape appear to move onto the slide from outside the slide boundaries, such as flying in from the right edge of the slide; or having the shape become visible in place in a particular manner, such as dissolving into visibility.

By default, if you do not set an animation effect for a shape, PowerPoint uses the ‘Appear’ effect, ppEntryEffectAppear. The code example in the following section demonstrates this.

Tomorrow, we’ll tackle setting the animation order of the shapes on a slide, and how to trigger a shape’s animation effect.

Comments