ColorEffect.From property (PowerPoint)

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

Syntax

expression. From

expression A variable that represents a ColorEffect object.

Remarks

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

Do not confuse this property with the FromX or FromY 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 immediately changes its color.

Sub AddAndChangeColorEffect() 
    Dim effBlinds As Effect 
    Dim tlnTiming As TimeLine 
    Dim shpRectangle As Shape 
    Dim animColorEffect As AnimationBehavior 
    Dim clrEffect As ColorEffect 
 
    'Adds rectangle and sets effect and animation 
    Set shpRectangle = ActivePresentation.Slides(1).Shapes _ 
        .AddShape(Type:=msoShapeRectangle, Left:=100, _ 
        Top:=100, Width:=50, Height:=50) 
    Set effBlinds = t.MainSequence.AddEffect(Shape:=shpRectangle, _ 
        effectId:=msoAnimEffectBlinds) 
    Set animColorEffect = tlnTimming.MainSequence(1).Behaviors _ 
        .Add(Type:=msoAnimTypeColor) 
    Set clrEffect = animColorEffect.ColorEffect 
 
    'Sets the animation effect starting and ending colors 
    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.