Application.SlideShowNextSlide イベント (PowerPoint)

次のスライドに切り替わる直前に発生します。 最初のスライドでは、 SlideShowBegin イベントの直後に発生します。

構文

SlideShowNextSlide(Wn)

Application オブジェクトを返す式。

パラメーター

名前 必須 / オプション データ型 説明
Wn 必須 SlideShowWindow アクティブなスライド ショー ウィンドウです。

注釈

Application オブジェクトでイベントを使用する方法については、「使い方: Application オブジェクトでイベントを使用する」を参照してください。

次の使用例は、 SlideShowNextSlide イベントに続くスライドのスライドの位置を決定します。 次のスライドがスライド 3 である場合の例は、ペンとペンの色を赤にポインターの種類を変更します。

Private Sub App_SlideShowNextSlide(ByVal Wn As SlideShowWindow)



   Dim Showpos As Integer



   Showpos = Wn.View.CurrentShowPosition + 1

If Showpos = 3 Then  

         With ActivePresentation.SlideShowSettings.Run.View

            .PointerColor.RGB = RGB(255, 0, 0)

            .PointerType = ppSlideShowPointerPen

         End With

      Else

         With ActivePresentation.SlideShowSettings.Run.View

            .PointerColor.RGB = RGB(0, 0, 0)

            .PointerType = ppSlideShowPointerArrow

         End With

      End If

End Sub

次の使用例は、グローバル カウンター変数を 0 に設定します。 次に、このイベントに続くスライド上の図形数を計算し、どの図形にアニメーションが設定されているかを判別し、グローバル配列にアニメーションの順序と各図形の番号を設定します。

注:

[!メモ] この例で作成された配列は、 SlideShowNextBuild イベントの例でも使用されます。

Private Sub App_SlideShowNextSlide(ByVal Wn As SlideShowWindow)



   Dim i as Integer, j as Integer, numShapes As Integer

   Dim objSld As Slide



   Set objSld = ActivePresentation.Slides _
        (ActivePresentation.SlideShowWindow.View _
        .CurrentShowPosition + 1)

      With objSld.Shapes

         numShapes = .Count

         If numShapes > 0 Then

            j = 1

            ReDim shpAnimArray(1 To 2, 1 To numShapes)

            For i = 1 To numShapes

               If .Item(i).AnimationSettings.Animate Then

                  shpAnimArray(1, j) = _
                     .Item(i).AnimationSettings.AnimationOrder

                     shpAnimArray(2, j) = i

                     j = j + 1

               End If

            Next

         End If

      End With

End Sub

関連項目

Application オブジェクト

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。