设置或返回 ColorFormat 对象,该对象代表动画动作颜色的初始 RGB 值。
expression.From
expression 必选。该表达式返回一个 ColorEffect 对象。
将此属性与 To 属性联合使用以便在一种颜色和另一种颜色之间切换。
应用于 RotationEffect 对象的 From 属性。
设置或返回 Single 类型值,该值代表相对于屏幕(例如,90 度表示完全水平)指定的初始角度。可读写。
expression.From
expression 必选。该表达式返回一个 RotationEffect 对象。
将此属性与 To 属性联合使用以从一个旋转角度切换到另一个旋转角度。
默认值为 Empty,此情况下使用对象的当前位置。
应用于 PropertyEffect 对象的 From 属性。
设置或返回 Variant 类型值,该值代表对象属性的初始值。可读写。
expression.From
expression 必选。该表达式返回一个 PropertyEffect 对象。
From 属性类似于 Points 属性,但对于简单任务,使用 From 属性更方便。
默认值为 Empty,此情况下使用对象的当前位置。
请勿将此属性与 ScaleEffect 和 MotionEffect 对象的 FromX 或 FromY 属性相混淆,后者仅用于缩放或移动效果。
以下示例添加颜色效果并且立即更改其颜色。
Sub AddAndChangeColorEffect()
Dim effBlinds As Effect
Dim tlnTiming As TimeLine
Dim shpRectangle As Shape
Dim animColorEffect As AnimationBehavior
Dim clrEffect As ColorEffect
'Adds rectangle and sets effect and animation
Set shpRectangle = ActivePresentation.Slides(1).Shapes _
.AddShape(Type:=msoShapeRectangle, Left:=100, _
Top:=100, Width:=50, Height:=50)
Set effBlinds = t.MainSequence.AddEffect(Shape:=shpRectangle, _
effectId:=msoAnimEffectBlinds)
Set animColorEffect = tlnTimming.MainSequence(1).Behaviors _
.Add(Type:=msoAnimTypeColor)
Set clrEffect = animColorEffect.ColorEffect
'Sets the animation effect starting and ending colors
clrEffect.From.RGB = RGB(Red:=255, Green:=255, Blue:=0)
clrEffect.To.RGB = RGB(Red:=0, Green:=255, Blue:=255)
End Sub
以下示例添加一个旋转效果并立即更改其旋转角度。
Sub AddAndChangeRotationEffect()
Dim effBlinds As Effect
Dim tlnTiming As TimeLine
Dim shpRectangle As Shape
Dim animRotation As AnimationBehavior
Dim rtnEffect As RotationEffect
'Adds rectangle and sets effect and animation
Set shpRectangle = ActivePresentation.Slides(1).Shapes_
.AddShape(Type:=msoShapeRectangle, Left:=100, _
Top:=100, Width:=50, Height:=50)
Set tlnTiming = ActivePresentation.Slides(1).TimeLine
Set effBlinds = tlnTiming.MainSequence.AddEffect(Shape:=shpRectangle, _
effectId:=msoAnimEffectBlinds)
Set animRotation = tlnTiming.MainSequence(1).Behaviors _
.Add(Type:=msoAnimTypeRotation)
Set rtnEffect = animRotation.RotationEffect
'Sets the rotation effect starting and ending positions
rtnEffect.From = 90
rtnEffect.To = 270
End Sub