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