ColorEffect.By Property
Returns a ColorFormat object that represents a change to the color of the object by the specified number, expressed in RGB format. Read-only.
Namespace: Microsoft.Office.Interop.PowerPoint
Assembly: Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)
Syntax
'Declaration
ReadOnly Property By As ColorFormat
Get
'Usage
Dim instance As ColorEffect
Dim value As ColorFormat
value = instance.By
ColorFormat By { get; }
Property Value
Type: Microsoft.Office.Interop.PowerPoint.ColorFormat
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.
Examples
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