ColorEffect.By プロパティ (PowerPoint)

RGB 形式で表される、数値で指定して、オブジェクトの色の変更を表す ColorFormat オブジェクトを返します。 読み取り専用です。

構文

By

ColorEffect オブジェクトを表す変数。

注釈

このプロパティには、 ByX または ByY プロパティを ScaleEffect および MotionEffect オブジェクトの拡大/縮小またはアニメーション効果にのみ使用されると混同しないでください。

次の使用例は、色効果を追加し、その色を変更します。 この使用例では、作業中のプレゼンテーションのスライド 1 に少なくとも 1 つの図形があることを仮定しています。

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 のサポートおよびフィードバックを参照してください。