【发布时间】:2014-08-21 15:20:48
【问题描述】:
我正在尝试将切换按钮插入到 powerpoint 的多个页面中。我有按钮可以按我想要的方式运行,但现在我看不到做两件事:
A.运行程序!!!除了我的第一个代码(见下文)之外,我已经删除了所有内容并从头开始,并且没有其他任何内容。我需要什么来修复它。当我单击连接到 YourName() 的形状时,没有任何反应。
B.我想在开始时将按钮的值设置为 0。一旦运行,你认为我的代码会这样做吗?
谢谢
Sub YourName()
Dim userName As String
Dim ToggleButton1 As ToggleButton
Dim ToggleButton2 As ToggleButton
Dim ToggleButton3 As ToggleButton
Dim ToggleButton4 As ToggleButton
Dim done As Boolean
done = False
While Not done
userName = InputBox(Prompt:="My name is", Title:="Input Name")
If userName = "" Then
done = False
Else
done = True
End If
Wend
FeedbackAnswered = False
ActivePresentation.Slides(2).ToggleButton("ToggleButton1").Value = 0
ActivePresentation.Slides(2).ToggleButton("ToggleButton2").Value = 0
ActivePresentation.Slides(2).ToggleButton("ToggleButton3").Value = 0
ActivePresentation.Slides(2).ToggleButton("ToggleButton4").Value = 0
ActivePresentation.SlideShowWindow.View.Next
End Sub
【问题讨论】:
标签: vba button toggle powerpoint