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

ColorEffect.From Property (PowerPoint)

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

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


expression. From

expression A variable that represents a ColorEffect object.


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.


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, _ 
    Set animColorEffect = tlnTimming.MainSequence(1).Behaviors _ 
    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

© 2018 Microsoft