怎么利用vba判断powerpoint中自定义动画播放的速度
如何利用vba判断powerpoint中自定义动画播放的速度
如何利用VBA判断已经完成的powerpoint作品中某张幻灯片中的某个对象的自定义动画效果及播放速度是否正确。
如:设置第5张幻灯片的正文动画为“展开”效果,速度为“中速”,怎样利用VBA判断其操作是否正确。
------解决方案--------------------
------解决方案--------------------
------解决方案--------------------
有不明白的再问。
------解决方案--------------------
把你的ppt发给我, dsd999@sohu.com
------解决方案--------------------
------解决方案--------------------
把这段代码拷贝到vbe的里。
把光标放到过程代码的任意地方。
运行后就能看到那个shape添加了动画。
------解决方案--------------------
把ppt发给你了。
ppt里有两个过程,执行完AddAnimation 后 执行CheckAnimation。
------解决方案--------------------
加判断。
------解决方案--------------------
如何利用VBA判断已经完成的powerpoint作品中某张幻灯片中的某个对象的自定义动画效果及播放速度是否正确。
如:设置第5张幻灯片的正文动画为“展开”效果,速度为“中速”,怎样利用VBA判断其操作是否正确。
------解决方案--------------------
If ActivePresentation.Slides(5).SlideShowTransition.EntryEffect = ppEffectBoxOut And _
ActivePresentation.Slides(5).SlideShowTransition.Speed = ppTransitionSpeedMedium Then
MsgBox "right"
Else
MsgBox "wrong"
End If
------解决方案--------------------
If ActivePresentation.Slides(2).TimeLine.MainSequence.Item(1).Shape.Name = "Rectangle 2" Then
If ActivePresentation.Slides(2).TimeLine.MainSequence.Item(1).Timing.Duration = 2 And _
ActivePresentation.Slides(2).TimeLine.MainSequence.Item(1).EffectParameters.Direction = msoAnimDirectionOut Then
MsgBox "right"
Else
MsgBox "wrong"
End If
End If
------解决方案--------------------
有不明白的再问。
------解决方案--------------------
把你的ppt发给我, dsd999@sohu.com
------解决方案--------------------
Sub AddAnimation()
Dim sldActive As Slide
Dim shpSelected As Shape
Dim slEffect As Effect
Set sldActive = ActivePresentation.Slides(5)
Set shpSelected = sldActive.Shapes(1)
Set slEffect = sldActive.TimeLine.MainSequence.AddEffect(Shape:=shpSelected, effectId:=msoAnimEffectBox)
slEffect.EffectParameters.Direction = msoAnimDirectionOut
slEffect.Timing.Duration = 2
End Sub
------解决方案--------------------
把这段代码拷贝到vbe的里。
把光标放到过程代码的任意地方。
运行后就能看到那个shape添加了动画。
------解决方案--------------------
把ppt发给你了。
ppt里有两个过程,执行完AddAnimation 后 执行CheckAnimation。
------解决方案--------------------
加判断。
Sub CheckAnimation()
If ActivePresentation.Slides(5).TimeLine.MainSequence.Count > 0 Then
If ActivePresentation.Slides(5).TimeLine.MainSequence.Item(1).Timing.Duration = 2 And _
ActivePresentation.Slides(5).TimeLine.MainSequence.Item(1).EffectParameters.Direction = msoAnimDirectionOut Then
MsgBox "right"
Else
MsgBox "wrong"
End If
Else
MsgBox "no animation"
End If
End Sub
------解决方案--------------------