PowerPoint VBA教程:MotionEffect对象

   
AnimationBehavior
MotionEffect
ShapeNodes

代表 AnimationBehavior对象的动作效果。

使用 MotionEffect对象

使用 AnimationBehavior对象的MotionEffec属性返回 MotionEffect对象。以下示例引用给定动画动作的动作效果。


ActivePresentation.Slides(1).TimeLine.MainSequence.Item.Behaviors(1).MotionEffect

使用 MotionEffect对象的ByXByYFromXFromYToXToY属性创建动作路径。以下示例在第一张幻灯片中添加一个形状并创建动作路径。


Sub AddMotionPath()
    Dim shpNew As Shape
    Dim effNew As Effect
    Dim aniMotion As AnimationBehavior
    Set shpNew = ActivePresentation.Slides(1).Shapes _
        .AddShape(Type:=msoShape5pointStar, Left:=0, _
        Top:=0, Width:=100, Height:=100)
    Set effNew = ActivePresentation.Slides(1).TimeLine.MainSequence _
        .AddEffect(Shape:=shpNew, effectId:=msoAnimEffectCustom, _
        Trigger:=msoAnimTriggerWithPrevious)
    Set aniMotion = effNew.Behaviors.Add(msoAnimTypeMotion)
    With aniMotion.MotionEffect
        .FromX = 0
        .FromY = 0
        .ToX = 500
        .ToY = 500
    End With
End Sub

上页:PowerPoint VBA教程:Master对象 下页:PowerPoint VBA教程:NamedSlideShow对象

PowerPoint VBA教程:MotionEffect对象

PowerPoint VBA教程:NamedSlideShow对象 PowerPoint VBA教程:NamedSlideShows集合对象
PowerPoint VBA教程:ObjectVerbs对象 PowerPoint VBA教程:OLEFormat对象
PowerPoint VBA教程:Options对象 PowerPoint VBA教程:PageSetup对象
PowerPoint VBA教程:Pane对象 PowerPoint VBA教程:Panes集合对象
PowerPoint VBA教程:ParagraphFormat对象 PowerPoint VBA教程:PictureFormat对象
PowerPoint VBA教程:PlaceholderFormat对象 PowerPoint VBA教程:Placeholders集合对象
PowerPoint VBA教程:PlaySettings对象 PowerPoint VBA教程:Presentation对象
PowerPoint VBA教程:Presentations集合对象 PowerPoint VBA教程:PrintOptions对象
PowerPoint VBA教程:PrintRange对象 PowerPoint VBA教程:PrintRanges集合对象
PowerPoint VBA教程:PropertyEffect对象 PowerPoint VBA教程:PublishObject对象
版权所有 © 中山市飞娥软件工作室 证书:粤ICP备09170368号