VBA for PowerPoint中是否存在IF隐藏语句?
我试图在PowerPoint中编写一个宏,它基本上是一个IF语句。我有4个盒子,我有动画,当它们被点击时,它们会淡出。是否可以有一个宏来识别所有4个框何时消失,然后在第五个框中淡出VBA for PowerPoint中是否存在IF隐藏语句?,vba,ms-office,powerpoint,Vba,Ms Office,Powerpoint,我试图在PowerPoint中编写一个宏,它基本上是一个IF语句。我有4个盒子,我有动画,当它们被点击时,它们会淡出。是否可以有一个宏来识别所有4个框何时消失,然后在第五个框中淡出 因此,4个框在用户控件上消失,然后一旦它们全部消失,第五个框就会自动出现。这可能吗?不需要vba。给第五个你喜欢的动画,然后将其设置为在上一个之后。如果需要,增加延迟。在前一个(即第四个形状)消失后,它将进入动画。啊。谢谢你的澄清 给你: ' Give each of the four shapes an actio
因此,4个框在用户控件上消失,然后一旦它们全部消失,第五个框就会自动出现。这可能吗?不需要vba。给第五个你喜欢的动画,然后将其设置为在上一个之后。如果需要,增加延迟。在前一个(即第四个形状)消失后,它将进入动画。啊。谢谢你的澄清 给你:
' Give each of the four shapes an action setting of Run Macro: HideMe
Sub HideMe(oSh As Shape)
Dim oSl As Slide
' hide the clicked shape
oSh.Visible = False
' test to see if all four shapes are hidden now
' edit to reflect the actual names of the shapes in use
Set oSl = oSh.Parent ' the slide containing the clicked shape
With oSl
If Not .Shapes("Rectangle 3").Visible Then
If Not .Shapes("Rectangle 4").Visible Then
If Not .Shapes("Rectangle 5").Visible Then
If Not .Shapes("Rectangle 6").Visible Then
' they're all hidden, so make the new shape visible
.Shapes("Rectangle 7").Visible = True
End If
End If
End If
End If
End With
End Sub
Sub MakeMeInvisible()
' run this after selecting the final shape
' to make it invisible to begin with
ActiveWindow.Selection.ShapeRange(1).Visible = False
End Sub
我根本不知道ppt脚本,但大多数动画处理程序在完成时都有某种方式发出信号。计算您收到的“完成”通知的数量,当您点击4时,在第5个框开始淡入淡出。您不必编写宏来完成此操作。PP中有动画控件作为标准解决方案。为什么要比VBA?如何计算完成的通知数?我尝试了后一个,但问题是当4个框消失时,人们会随机选择。如果首先单击触发第五个框入口的框,则无论是否已单击其他三个框,该框都将显示。