VB超级参考

时间:2018-11-27 15:25:56

标签: vb.net powerpoint

我已经在下面编写了代码,但是它不起作用。有人可以为我指出错误吗?

Private Sub CommandButton1_click()
   If Slide1.m.Text = g Then
      ActivePresentation.SlideShowWindow.View.GotoSlide 3
   ElseIf Slide1.m.Text = h Then
     ActivePresentation.SlideShowWindow.View.GotoSlide 4
   Else
     ActivePresentation.SlideShowWindow.View.GotoSlide 1
   End If
End Sub

1 个答案:

答案 0 :(得分:0)

根据我上面的评论,您在if语句中缺少引号。

Private Sub CommandButton1_click()
   If Slide1.m.Text = "g" Then
      ActivePresentation.SlideShowWindow.View.GotoSlide 3
   ElseIf Slide1.m.Text = "h" Then
     ActivePresentation.SlideShowWindow.View.GotoSlide 4
   Else
     ActivePresentation.SlideShowWindow.View.GotoSlide 1
   End If
End Sub