SlideShowNextSlide Event Example
This example determines the slide position for the slide following the SlideShowNextSlide event. If the next slide is slide three, the example changes the type of pointer to a pen and the pen color to red.
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
This example sets a global counter variable to zero. Then it calculates the number of shapes on the slide following this event, determines which shapes have animation, and fills a global array with the animation order and the number of each shape.
Note The array created in this example is also used in the SlideShowNextBuild event example.
Private Sub App_SlideShowNextSlide(ByVal Wn As SlideShowWindow)
Dim i, j, numShapes As Integer
Dim objSld As Slide
EvtCounter = 0
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