設定或傳回 ColorFormat 物件,代表動畫行為的起始 RGB 色彩值。
語法
expression。 From
詞 一個代表 ColorEffect 物件的變數。
註解
將這個屬性搭配 To 屬性使用,即可從某個色彩轉換成另一個色彩。
請勿將此屬性與 FromX 或 FromY 屬性的 ScaleEffect 和 MotionEffect 物件,這用於調整效果或動作效果。
範例
下列範例會加入新的色彩效果,並立即變更其顏色。
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
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。