ConvertToTextUnitEffect Method

Microsoft PowerPoint Visual Basic

Show All

ConvertToTextUnitEffect Method

       

Returns an Effect object that represents how text should animate.

expression.ConvertToTextUnitEffect(Effect, unitEffect)

expression   Required. An expression that returns a Sequence object.

Effect  Required Effect object. The animation effect to which the text unit effect applies.

unitEffect  Required MsoAnimTextUnitEffect. How the text should animate.

MsoAnimTextUnitEffect can be one of these MsoAnimTextUnitEffect constants.
msoAnimTextUnitEffectByCharacter
msoAnimTextUnitEffectByParagraph
msoAnimTextUnitEffectByWord
msoAnimTextUnitEffectMixed

Example

This example adds an animation to a given shape and animates its accompanying text by character.

Sub NewTextUnitEffect()
    Dim shpFirst As Shape
    Dim tmlMain As TimeLine

    Set shpFirst = ActivePresentation.Slides(1).Shapes(1)
    Set tmlMain = ActivePresentation.Slides(1).TimeLine

    tmlMain.MainSequence.ConvertToTextUnitEffect _
        Effect:=tmlMain.MainSequence.AddEffect(Shape:=shpFirst, _
            EffectID:=msoAnimEffectRandomEffects), _
        unitEffect:=msoAnimTextUnitEffectByCharacter
End Sub