ColorEffect.To property (PowerPoint)

Sets or returns a ColorFormat object that represents the RGB color value of an animation behavior. Read/write.

Syntax

expression. To

expression A variable that represents a ColorEffect object.

Return value

ColorFormat

Remarks

Use this property in conjunction with the From property to transition from one color to another.

Do not confuse this property with the ToX or ToY properties of the ScaleEffect and MotionEffect objects, which are only used for scaling or motion effects.

Example

The following example adds a color effect and changes its color from a light bluish green to yellow.

Sub AddAndChangeColorEffect()

    Dim effBlinds As Effect
    Dim tmlTiming As TimeLine
    Dim shpRectangle As Shape
    Dim animColor As AnimationBehavior
    Dim clrEffect As ColorEffect

    Set shpRectangle = ActivePresentation.Slides(1).Shapes _
        .AddShape(Type:=msoShapeRectangle, Left:=100, _
        Top:=100, Width:=50, Height:=50)

    Set tmlTiming = ActivePresentation.Slides(1).TimeLine
    Set effBlinds = tmlTiming.MainSequence.AddEffect(Shape:=shpRectangle, _
        effectId:=msoAnimEffectBlinds)

    Set animColor = tmlTiming.MainSequence(1).Behaviors _
        .Add(Type:=msoAnimTypeColor)

    Set clrEffect = animColor.ColorEffect
    clrEffect.From.RGB = RGB(Red:=255, Green:=255, Blue:=0)
    clrEffect.To.RGB = RGB(Red:=0, Green:=255, Blue:=255)

End Sub

See also

ColorEffect Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.