我正在制作一个 PowerPoint,我不断地使用这个命令来跳转幻灯片:
With SlideShowWindows(1)
.View.GoToSlide (.Presentation.Slides(x).SlideIndex)
End With
我想通过编写一个可以缩短它的模块来缩短它,但由于我是一个新手并且真的不知道如何,我真的需要帮助。这是我编写的“SlideControl”模块:
Public Intro As String, BIOS As String, OSBegin As String, InitialSetup As String, LogIn As String, Desktop As String
Public Sub GoToSlide(Slide)
Intro = SlideShowWindows(1).Presentation.Slides(1).SlideIndex
BIOS = SlideShowWindows(1).Presentation.Slides(2).SlideIndex
OSBegin = SlideShowWindows(1).Presentation.Slides(5).SlideIndex
InitialSetup = SlideShowWindows(1).Presentation.Slides(6).SlideIndex
LogIn = SlideShowWindows(1).Presentation.Slides(9).SlideIndex
Desktop = SlideShowWindows(1).Presentation.Slides(11).SlideIndex
SlideShowWindows(1).View.GoToSlide (Slide)
End Sub
那是整个模块,最后没有别的了。当然,我是编码新手,所以如果代码看起来不对,请帮助我纠正它。我想我应该可以使用以下命令进入介绍幻灯片:
GoToSlide (Intro)
然后当我调用它时出现此错误:
Compile error:
Only comments may appear after End Sub, End Function, or End Property
谁能帮我解决这个问题?我会非常感激。