@SteveRindsbergのおかげで、プレゼンテーションモードを切り替えるかどうかを決定する(b)スイッチが必要な場合は、コードを実行して設定を変更し、(c)プログラムでスライドショーを終了し、(d)プログラムでスライドショーを再起動するコードを実行します。
PowerPointはデフォルトでキオスクモードで実行されるように保存されているため、標準ユーザーはPageDownやその他のナビゲーション技術を使用してスライドを移動することはできません。つまり、スライドは、VBAコードを使用してスライドショーを移動するプログラマのActiveXコントロールによってのみ操作できます。 (これはクイズ型のスライドショーなどに便利です)
具体的には、スライド1にはActiveX [OK]ボタンがあり、これをクリックして続行します。基本的に、スライド1は、PowerPointの名前を示すタイトルスライドです。 OKボタンをクリックすると、[OK]ボタンの後ろにあるコードが、プレゼンテーションモードをデフォルトのキオスクモードからスピーカーモードに変更できるかどうかを確認します。
Private Sub cmdFeedbackOK_Click()
'handle the click of the OK button on the feedback which will move to the next slide or exit if the wrong OS or Office Version (based on text associated with the [OK] button
'check for superuser
If LCase(Environ("UserName")) = "{Windows username who is a superuser}" And ActivePresentation.SlideShowSettings.ShowType <> ppShowTypeSpeaker Then 'this will check to be sure that we have not already changed the ShowType (which will have changed if the user opts to switch modes and the PPTX has re-started)
'superuser, so, change to Speaker mode
If MsgBox("Do you want to switch to Speaker view instead of Kiosk view so you can use PageDown?", vbYesNo + vbDefaultButton1, "Use PageDown?") = vbYes Then
ActivePresentation.SlideShowSettings.ShowType = ppShowTypeSpeaker 'switch from Kiosk to Speaker mode so that PageDown key will work
ActivePresentation.SlideShowSettings.AdvanceMode = ppSlideShowManualAdvance 'switch to allow PageDown to manually advance the slides
ActivePresentation.SlideShowWindow.View.Exit 'exit the show because the change in play mode and advance mode will not take effect until the show is started again
ActivePresentation.SlideShowSettings.Run 'restart the show; code in the OnSlideShowPageChange will get triggered to skip this first slide if the user has restarted the show
Exit Sub
End If
End If
ActivePresentation.SlideShowWindow.View.Next 'move to next slide
End Sub
スライドショー再起動すると、私はOnSlideShowPageChangeに次のコードを追加した際に二回最初のスライドを表示することからスーパーユーザを防ぐために、次に:ここではスライド1で、[OK]ボタンの背後にあるコードですイベント:私にとって
SlideName = ActivePresentation.SlideShowWindow.View.Slide.Name
If SlideName = "sldTitle" Then 'we're on the first slide
If ActivePresentation.SlideShowSettings.ShowType = ppShowTypeSpeaker Then 'this will be true if the Windows user is me (see code in Slide1), and, since I've already seen that slide, just go to the next slide
ActivePresentation.SlideShowWindow.View.Next 'skip the first slide for superuser
'execute other code as desired
'use Exit Sub here if the code below does not need to run for the superuser
End If
End If
'execute other code as desired here, e.g., code for standard users
、1スライドは、スライドショー再起動する前に、[OK]ボタンをクリックした後に長い遅延(多分10秒)を与えるが、標準的なユーザーは、Iドンので、遅延は発生しません。待ち時間を気にしないでください - おそらく、VBAコードと多数のActiveXコントロールを持つプレゼンテーション内の多数のスライドと関係があります。少なくとも、それは私の推測。
これは誰かを助けることを願っています!
出典
2016-07-26 13:44:08
DRC
a)スライドショーを終了し、b)スライドショーモードを変更してから、c)スライドショーを再開してみましたか? –
ああ!もちろん!ありがとう、@ SteveRindsberg。それがトリックでした。スライドショーを終了/再起動するコードと実際に再起動するコードとの間には、非常に長い遅延がありますが、*動作します。回答として提出してください、私はそのようにマークします。 – DRC
助けてくれたことをうれしく思っていますが、作業コードを回答として提出すると、より直接的に他の人を助けることができます。 –