ConvertToAnimateBackground Method

Microsoft PowerPoint Visual Basic

Show All

ConvertToAnimateBackground Method

       

Determines whether the background will animate separately from, or in addition to, its accompanying text. Returns an Effect object representing the newly-modified animation effect.

expression.ConvertToAnimateBackground(Effect, AnimateBackground)

expression   Required. An expression that returns a Sequence object.

Effect  Required Effect object. The animation effect to be applied to the background.

AnimateBackground  Required MsoTriState. Determines whether the text will animate separately from the background.

MsoTriState can be one of these MsoTriState constants.
msoCTrue
msoFalse Animates text separately from the background. 
msoTriStateMixed
msoTriStateToggle
msoTrue Animates text along with the background.

Example

This example creates a text effect for the first shape on the first slide in the active presentation, and animates the text in the shape separately from the background. This example assumes there is a shape on the first slide, and that the shape has text inside of it.

Sub AnimateText()

    Dim timeMain As TimeLine
    Dim shpActive As Shape

    Set shpActive = ActivePresentation.Slides(1).Shapes(1)
    Set timeMain = ActivePresentation.Slides(1).TimeLine

    ' Add a blast effect to the text, and animate the text separately
    ' from the background.
    timeMain.MainSequence.ConvertToAnimateBackground _
        Effect:=timeMain.MainSequence.AddEffect(Shape:=shpActive, _
            effectid:=msoAnimEffectBlast), _
        AnimateBackGround:=msoFalse

End Sub