如何在 VBA 中实现消失的动画? [英] How to implement disappearing animations in VBA?

查看:38
本文介绍了如何在 VBA 中实现消失的动画?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 VBA 程序中测试形状上的效果动画.

I'm trying to test effect animations on shapes in a VBA procedure.

我已经实现了在 MainSequence 中添加一些新动画,定义在 Timeline 中的哪个位置...但我无法创建消失的动画.

I've already achieved one which is adding some new animations in the MainSequence, defining in which position in the Timeline... but I am not able to create disapearing animations.

我检查了一些已经存在的代码的开头......并且 EffectType 似乎返回与相关出现动画相同的值,所以我很遗憾地相信没有办法在 VBA 中创建消失的动画.

I checked in the beginning of the code some already there...and the EffectType seems to return the same value as related appearing animation, so that I sadly believe there's no way of creating disapearing animations in VBA.

请告诉我我错了,我必须在 300 多张幻灯片上做同样的创作...

Please tell me I am wrong, I have to do the same creations on over 300 slides...

推荐答案

是的,你错了,但是文档是......好吧,我想你已经知道了.

Yes, you are wrong, however documentation to that is... well, I guess you know that already.

这是诀窍.要添加消失动画,您必须添加出现动画,但将其退出"属性设置为msoTrue"

Here's the trick. To add a disappearing animation you have to add appearing animation but set it's 'Exit' property to 'msoTrue'

看看这个代码示例:

Private Sub SetAnimation()
    Dim effNewEffect As Effect

    With ActiveWindow.View.Slide
        Set effNewEffect = .TimeLine.MainSequence.AddEffect(.Shapes(.Shapes.Count), msoAnimEffectAppear, trigger:=msoAnimTriggerWithPrevious, Index:=-1)
    End With
    effNewEffect.Timing.TriggerDelayTime = 1.0
    effNewEffect.Exit = msoTrue
End Sub

它将向当前幻灯片中的最后一个 Shape 添加一个消失动画,作为 MainSequence 中的最后一个,与前一个动画延迟 1.0 秒.

It will add a Disappear animation to the last Shape in a current slide as the last in the MainSequence with delay 1.0 s to the previous animation.

这篇关于如何在 VBA 中实现消失的动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆