私は常にこのコマンドを使用してスライドを移動する 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
誰でもこれを修正するのを手伝ってもらえますか? よろしくお願いします。