Pausing movie with vb

  • Thread starter Thread starter george 16-17
  • Start date Start date
G

george 16-17

Greetings all,

I am very new to PP vb and I have adapted the following code below based on
http://skp.mvps.org/ppt00040.htm#5 . I have a movie with an animation (a line
that wipes from the left that is set to the same speed as the length of the
video) that plays automatically. I have placed buttons on the slide to pause
and play the movie.

The code works fine, but the problem is when the movie ends. The buttons
will changed color when clicked even though the movie is not playing. I think
I need another If statement about whether the movie is actively playing. Can
anyone assist?

Here is the code:

Sub PauseShow()
'Pause button
With ActivePresentation.SlideShowWindow
If .View.State = ppSlideShowRunning Then
.View.State = ppSlideShowPaused
.View.Slide.Shapes("Play").TextFrame _
.TextRange.Font.Color = RGB(166, 166, 166) 'gray
.View.Slide.Shapes("Pause").TextFrame _
.TextRange.Font.Color = RGB(0, 43, 84) 'dark blue
End If
End With

End Sub

Sub ResumeShow()
'Play button
With ActivePresentation.SlideShowWindow
If .View.State = ppSlideShowPaused Then
.View.State = ppSlideShowRunning
.View.Slide.Shapes("Pause").TextFrame _
.TextRange.Font.Color = RGB(166, 166, 166)
.View.Slide.Shapes("Play").TextFrame _
.TextRange.Font.Color = RGB(0, 43, 84)
End If
End With

End Sub

Any assistance is appreciated and thanks in advance,
george
 
Hi Austin,

Thanks for replying. I thought it might be better to pause the slide since I
also have the animation on it. The animation is essentially a progress bar
how much of the video has been played. I apologized if this does not make
sense.

Is there a better method?

Again, much appreciated,
george
 
Asuming you have one slide and on it is a video... (alter for your needs)

With ActivePresentation.Slides(1).Shapes(1) _
.ActionSettings(ppMouseClick)
.ActionVerb = "Pause"
.Action = ppActionOLEVerb
End With




Austin Myers
AT&W Technologies

Creators PowerPoint Add-Ins
www.playsforcertain.com
 
Hi Austin,

Thanks for your assistance again. I'll give your code a try and post back
with any difficulties.

Much appreciated,
george
 
Back
Top