PowerPoint) (RotationEffect.By 属性

设置或返回 一个 表示对象的旋转由指定数目的度;例如,值为 180 表示旋转 180 度旋转对象。 读/写。

语法

expressionBy

表达 一个代表 RotationEffect 对象的变量。

备注

指定的对象将围绕其中心旋转,其中心在屏幕上的位置保持不变。

如果 属性都设置为旋转效果, 通过 属性的值将被忽略。

浮点数(例如 55.5)有效,但是负数无效。

不要混淆此 ByX 属性或 ByY 属性的 ScaleEffectMotionEffect 对象,仅用于缩放或动画效果。

示例

本示例添加一个旋转效果并且更改该效果的旋转角度。

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

另请参阅

RotationEffect 对象

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。