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

ColorEffect.By Property (PowerPoint)

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

Returns a ColorFormat object that represents a change to the color of the object by the specified number, expressed in RGB format. Read-only.

Syntax

expression. By

expression A variable that represents a ColorEffect object.

Remarks

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

Example

This example adds a color effect and changes its color. This example assumes there is at least one shape on the first slide of the active presentation.

Sub AddAndChangeColorEffect()

    Dim effBlinds As Effect
    Dim tmlnShape As TimeLine
    Dim shpShape As Shape
    Dim animBehavior As AnimationBehavior
    Dim clrEffect As ColorEffect

    'Sets shape, timing, and effect
    Set shpShape = ActivePresentation.Slides(1).Shapes(1)
    Set tmlnShape = ActivePresentation.Slides(1).TimeLine
    Set effBlinds = tmlnShape.MainSequence.AddEffect _
        (Shape:=shpShape, effectId:=msoAnimEffectBlinds)

    'Adds animation behavior and color effect
    Set animBehavior = tmlnShape.MainSequence(1).Behaviors _
        .Add(Type:=msoAnimTypeColor)
    Set clrEffect = animBehavior.ColorEffect

    'Specifies color
    clrEffect.By.RGB = RGB(Red:=255, Green:=0, Blue:=0)

End Sub

See also

Concepts

ColorEffect Object

© 2018 Microsoft