PowerPoint) (ColorEffect.By 属性
返回一个 ColorFormat 对象,该对象表示由指定的数量,以 RGB 格式表示的对象的颜色更改。 此为只读属性。
语法
expression。 By
表达 一个代表 ColorEffect 对象的变量。
备注
不要混淆此 ByX 属性或 ByY 属性的 ScaleEffect 和 MotionEffect 对象,仅用于缩放或动画效果。
示例
本示例添加颜色效果并且更改其颜色。 本示例假设当前演示文稿的第一张幻灯片中至少有一个形状。
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
另请参阅
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。