Powerpoint 全局按钮

Powerpoint global button

我认为对于任何具有一些 VBA 技能或 PowerPoint 专业版的人来说,这是一个简单的问题:

我有一个像测验一样的演示,我喜欢像 WWTBAM 一样提供三个笑话。 所以我创建了三个按钮,并制作了 50:50 按钮,点击它会启动动画,从而隐藏错误的答案。所以我现在只想说,如果您在一张幻灯片上单击了百搭按钮,则必须在所有其他后续幻灯片上将其删除/禁用/划线。

有没有人可以告诉我一个简单的片段来做到这一点?

那真是太好了。 谢谢!

这应该会让您朝着正确的方向前进:

Option Explicit

' The name of the shape(s) to search for
' (name shapes in the Selection Pane : Alt+F10 for PowerPoint 2010 and later)
Public Const ShapeName = "50/50"

' Purpose:  Macro to HIDE all shapes on all slides that match the specified name
' Usage:    Assign to any shape(s) on a slide via the Insert Tab / Action / Mouse Click / Run Macro
' Author:   Jamie Garroch of YOUpresent Ltd. (http://youpresent.co.uk/)
Public Sub HideAll()
  Dim oSld As Slide
  Dim oShp As Shape
  For Each oSld In ActivePresentation.Slides
    For Each oShp In oSld.Shapes
      If oShp.Name = ShapeName Then oShp.Visible = msoFalse
    Next
  Next
End Sub

' Purpose:  Macro to SHOW all shapes on all slides that match the specified name
' Usage:    Assign to any shape(s) on a slide via the Insert Tab / Action / Mouse Click / Run Macro
' Author:   Jamie Garroch of YOUpresent Ltd. (http://youpresent.co.uk/)
Public Sub ShowAll()
  Dim oSld As Slide
  Dim oShp As Shape
  For Each oSld In ActivePresentation.Slides
    For Each oShp In oSld.Shapes
      If oShp.Name = ShapeName Then oShp.Visible = msoTrue
    Next
  Next
End Sub