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

ColorEffect.To Property (PowerPoint)

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

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

Concepts

ColorEffect Object

© 2018 Microsoft