This not a method I would normally suggest as it can be unreliable. However in you specific case it should be fine. Just be aware it may not work in other situations.
It will reset checkboxes when the show ends (not if you have a goto start button though the show must close)
Sub OnSlideShowTerminate(Wn As SlideShowWindow)
Dim opres As Presentation
Dim osld As Slide
Dim oshp As Shape
Set opres = Wn.Parent
For Each osld In opres.Slides
For Each oshp In osld.Shapes
If oshp.Type = msoOLEControlObject Then
Debug.Print oshp.OLEFormat.ProgID
If oshp.OLEFormat.ProgID = "Forms.CheckBox.1" Then
oshp.OLEFormat.Object.Value = False
End If
End If
Next oshp
Next osld
End Sub
If you want the checks clearded at the last slide whether the show closes or not this can also be done buy you would need to be sure that you had collected any results before the boxes update!
Sub OnSlideShowPageChange(Wn As SlideShowWindow)
Dim opres As Presentation
Dim osld As Slide
Dim oshp As Shape
Set opres = Wn.Parent
If Wn.View.Slide.SlideIndex = opres.Slides.Count Then
For Each osld In opres.Slides
For Each oshp In osld.Shapes
If oshp.Type = msoOLEControlObject Then
Debug.Print oshp.OLEFormat.ProgID
If oshp.OLEFormat.ProgID = "Forms.CheckBox.1" Then
oshp.OLEFormat.Object.Value = False
End If
End If
Next oshp
Next osld
End If
End Sub
Last edited by JohnWilson; 07-09-2013 at 05:34 AM.
|