I'm using PowerPoint 2016.
I have found other questions on this forum (like here) that indicate the answer is to use the OnSlideShowPageChange or slideshownextslide events. However, it seems to me that these events do not fire.
I have the following code in a module in my presentation
Public Sub OnSlideShowPageChange(ByVal Wn As SlideShowWindow)
Dim i As Integer
Dim sld As Slide
Dim shp As Shape
Dim boxText As String
MsgBox "here"
Set sld = Application.ActiveWindow.View.Slide
'If Wn.View.CurrentShowPosition = 5 Then
If sld.SlideIndex = 5 Then
For Each shp In sld.Shapes
If shp.HasTextFrame Then
MsgBox "looking"
boxText = shp.TextFrame.TextRange.Text
If InStr(1, boxText, "10 Seconds") <> 0 Then 'we found the countdown box
For i = 1 To 10
Pause (1)
If i < 9 Then
shp.TextFrame.TextRange.Text = 10 - i & " seconds"
Else
shp.TextFrame.TextRange.Text = 10 - i & " second"
End If
Next i
End
End
Next shp
ActivePresentation.SlideShowWindow.View.Next
shp.TextFrame.TextRange.Text = "10 seconds"
End If
End Sub
But I never even see that first msgBox "here"....any idea where I'm going wrong?
The file I'm using is located here. Tried to put in some text boxes and code comments to make it clear what I'm looking to do