PowerPoint 如何同时 运行 宏和超链接?

PowerPoint How to Run Macro and Hyperlink at The Same Time?

我正在尝试在 PowerPoint 中选择您自己的游戏类型。该游戏包括一个积分系统,当用户单击一个选项时,我使用宏来完成该系统。我还需要一个超链接以根据所选择的选项跳转到正确的幻灯片。

我尝试为每个按钮创建 1 个宏,指定滑动跳转到的位置,但这变得太混乱了,因为到游戏结束时,将有数百个按钮 = 数百个宏。

Dim numCorrect As Integer
Dim numIncorrect As Integer
Dim userName As String
Dim printableSlideNum As Long 'ADDED
Sub GetStarted()
    Initialize
    ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub Initialize()
    numCorrect = 0
    numIncorrect = 0
    ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub Right()
    numCorrect = numCorrect + 10
End Sub
Sub Wrong()
    numIncorrect = numIncorrect + 25
End Sub
Sub Feedback()
    MsgBox "You spent " & numCorrect + numIncorrect & " minutes to solve the issue" & vbCr & _
    "Out of the " & numCorrect + numIncorrect & ", you wasted " & numIncorrect & " minutes by choosing the wrong options"
End Sub
Sub JumpTo(lSlideIndex As Long)
    SlideShowWindows(1).View.GotoSlide (lSlideIndex)
End Sub
Sub ONEA()
    Right
    JumpTo 6
End Sub

我有过创建一个根据形状名称跳转到幻灯片编号的宏的想法,但不知道是否可行。

示例:选项 B 跳转到幻灯片 60 形状名称为 60 vba 将匹配形状名称并跳转到幻灯片 60

感谢任何help/ideas!

注:我的VBA技能基本为零。

要为形状命名,请参阅How to name an object within a PowerPoint slide?


Sub JumpToSlide(oShp As Shape)

lSlideIndex = CLng(oShp.Name)
SlideShowWindows(1).View.GotoSlide (lSlideIndex)

End Sub

要将此宏分配给形状,您可以右键单击形状 --> 超链接 --> 运行 宏 --> Select "JumpToSlide"