Control Flash Movies during Slide Shows

If you use Flash movies on PowerPoint slides a lot, you would feel the need to control those flash movies during slide shows. The following routines help you get control over playing of Flash movies. To use these VBA routines, do the following:

  1. Add the relevant VBA macro to your PowerPoint presentation.
  2. Add a shape on the same slide as the Flash movie.
  3. Select the newly added shape and associate a Run macro action with it to run these macros:
    1. In PowerPoint 2003 and earlier versions, select Slide Show | Action Settings... menu item.
    2. In PowerPoint 2007, select Insert tab, Action button in Links group.
  4. Select Mouse Click tab
  5. Select Run macro option.
  6. Select the macro in the macro list.
  7. Click OK.

You can now control the Flash movie by clicking the shape on the same slide.

Playing the Flash movie:

The Play command plays the Flash movie from where you left it. To play the Flash movie from the beginning, look at the Rewind command below.

Sub FlashPlay()
    Dim Shp As Shape

    For Each Shp In SlideShowWindows(1).View.Slide.Shapes
        If Shp.Type = msoOLEControlObject Then
            If Shp.OLEFormat.ProgID Like "ShockwaveFlash.ShockwaveFlash.*" Then
                Shp.OLEFormat.Object.Play
                Exit For
            End If
        End If
    Next
End Sub

Stopping or Pausing the Flash movie:

It should be noted that stopping or pausing the Flash movie is the same command. The Play command plays from where you left playing the Flash movie. So, to resume a paused Flash movie, use the Play command as shown above.

Sub FlashStopOrPause()
    Dim Shp As Shape

    For Each Shp In SlideShowWindows(1).View.Slide.Shapes
        If Shp.Type = msoOLEControlObject Then
            If Shp.OLEFormat.ProgID Like "ShockwaveFlash.ShockwaveFlash.*" Then
                Shp.OLEFormat.Object.Stop
                Exit For
            End If
        End If
    Next
End Sub

Rewinding the Flash movie:

The Rewind command positions the play pointer to the start of the Flash movie. It does not automatically play the movie after rewinding. You need to use the Play command as shown above to play the Flash movie.

Sub FlashRewind()
    Dim Shp As Shape

    For Each Shp In SlideShowWindows(1).View.Slide.Shapes
        If Shp.Type = msoOLEControlObject Then
            If Shp.OLEFormat.ProgID Like "ShockwaveFlash.ShockwaveFlash.*" Then
                Shp.OLEFormat.Object.Rewind
                Exit For
            End If
        End If
    Next
End Sub

Contact OfficeOne on email at officeone@officeoneonline.com. Copyright © 2001-2023 OfficeOne. All rights reserved.