全部显示

SlideShowNextSlide 事件

       

切换到下一张幻灯片立刻发生此事件。对于第一张幻灯片,此事件紧跟在 SlideShowBegin 事件之后发生。

Private Sub application_SlideShowNextSlide(ByVal Wn As SlideShowWindow)

application   Application 类型的对象,在类模块中声明,自身具有事件。有关使用 Application 对象的事件的详细信息,请参阅使用 Application 对象的事件

Wn   活动幻灯片放映窗口。

示例

本示例确定了发生 SlideShowNextSlide 事件后幻灯片的位置。如果下一张幻灯片是第三张幻灯片,则本示例将鼠标指针的类型更改为笔形且颜色更改为红色。

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