ColorEffect.By property (PowerPoint)
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
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.