返回 ColorFormat 对象,该对象代表对象的颜色更改为以 RGB 格式表示的指定数值。
expression.By
expression 必选。该表达式返回一个 ColorEffect 对象。
设置或返回 Single 类型值,该值代表对象旋转的指定度数;例如,数值 180 表示对象旋转 180 度。可读写。
expression.By
expression 必选。该表达式返回一个 RotationEffect 对象。
指定的对象将围绕其中心旋转,其中心在屏幕上的位置保持不变。
如果同时设置了旋转效果的 By 和 To 属性,则 By 属性的值将被忽略。
浮点数有效(例如 55.5),但是负数无效。
请勿将此属性与 ScaleEffect 和 MotionEffect 对象的 ByX 或 ByY 属性相混淆,后者仅用于缩放或动作效果。
本示例添加颜色效果并且更改其颜色。本示例假设当前演示文稿的第一张幻灯片中至少有一个形状。
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
本示例添加旋转效果并且更改其旋转方式。
Sub AddAndChangeRotationEffect()
Dim effBlinds As Effect
Dim tmlnShape As TimeLine
Dim shpShape As Shape
Dim animBehavior As AnimationBehavior
Dim rtnEffect As RotationEffect
'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 sets rotation effect
Set animBehavior = tmlnShape.MainSequence(1).Behaviors _
.Add(Type:=msoAnimTypeRotation)
Set rtnEffect = animBehavior.RotationEffect
rtnEffect.By = 270
End Sub