Table of contents
TOC
Collapse the table of content
Expand the table of content

Effect Object (PowerPoint)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Represents timing information about a slide animation.

Example

Use the AddEffectmethod to add an effect. This example adds a shape to the first slide in the active presentation and adds an effect and a behavior to the shape.

Sub NewShapeAndEffect()

    Dim shpStar As Shape

    Dim sldOne As Slide

    Dim effNew As Effect



    Set sldOne = ActivePresentation.Slides(1)

    Set shpStar = sldOne.Shapes.AddShape(Type:=msoShape5pointStar, _

        Left:=150, Top:=72, Width:=400, Height:=400)

    Set effNew = sldOne.TimeLine.MainSequence.AddEffect(Shape:=shpStar, _

        EffectId:=msoAnimEffectStretchy, Trigger:=msoAnimTriggerAfterPrevious)

    With effNew

        With .Behaviors.Add(msoAnimTypeScale).ScaleEffect

            .FromX = 75

            .FromY = 75

            .ToX = 0

            .ToY = 0

        End With

        .Timing.AutoReverse = msoTrue

    End With

End Sub

To refer to an existing Effect object, use MainSequence (index), where index is the number of the Effect object in the Sequence collection. This example changes the effect for the first sequence and specifies the behavior for that effect.

Sub ChangeEffect()

    With ActivePresentation.Slides(1).TimeLine _

        .MainSequence(1)

        .EffectType = msoAnimEffectSpin

        With .Behaviors(1).RotationEffect

            .From = 100

            .To = 360

            .By = 5

        End With

    End With

End Sub

Methods

Name
Delete
MoveAfter
MoveBefore
MoveTo

Properties

Name
Application
Behaviors
DisplayName
EffectInformation
EffectParameters
EffectType
Exit
Index
Paragraph
Parent
Shape
TextRangeLength
TextRangeStart
Timing

See also

Other resources

PowerPoint Object Model Reference

© 2017 Microsoft