共用方式為


ColorEffect.By PowerPoint) (屬性

會傳回 ColorFormat 物件,代表所指定的數字,以 RGB 格式表示物件的色彩變更。 唯讀。

語法

expressionBy

一個代表 ColorEffect 物件的變數。

註解

請勿將此屬性與 ByXByY 屬性的 ScaleEffectMotionEffect 物件,這用於調整效果或動作效果。

範例

這個例子會加入一種色彩效果並改變其顏色。 此範例假設活躍呈現的第一張投影片至少有一個形狀。

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

另請參閱

ColorEffect 物件

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應