Embedded Video in PPT VBA Events

R

RDK45

....I have a PowerPoint 2000 presentation with an embedded video (Insert /
Movies and Sounds / Movie from a file) and it works just fine.

I would now like to trigger a wav sound file when the video starts and ends.
I assume there is an event which is triggered when either of these happen,
but for the life of me I can not seem to find it. I would also be helpful
if someone could enlighten me on the VBA code to identify the name, type,
.... of the object which is playing the video in the slide.

Thanks....RDK
 
R

RDK45

Steve....Thanks for the terminology adjustment regarding linked vs embedded.

Adding sound to the videos is not an option. :-(

Regarding the last part of my previous note:

I assumed that when I found out about the events, that they would be tied to
the object/control which is playing the video, much like when you embed the
Media Player control into a web page.

Thus I am looking for is a way to (while developing the PPT macro) determine
the name/item for the control which is playing the video. Then I could
construct the necessary event procedures to trigger the wav files.

Thus, the whole idea is to trap the event when the video starts (whether by
a user click or automatically when the slide opens) and finally when the
video is completed.

Can you offer any help?

Thanks....RDK
 
M

Mike M.

I have been able to do this in VBA with PowerPoint but only using the Media
Player object. It worked o.k. for my testing but I didn't go into
production with it. There are several events that go along with MediaPlayer
object. The only way I could make sure my videos played in WMP was to
insert a WMP object instead of Insert->Movies from file.
Here are a couple of highlights:
' See if I can get events from this object
Public WithEvents wmpObject As WindowsMediaPlayer

Private Sub PPTEvent_SlideShowBegin(ByVal Wn As SlideShowWindow)
For Each shp In slide.Shapes
With shp
' See if it is an OLE WMP active x control.
shapeType = .Type
If (shapeType = 12) Then
progID = .OLEFormat.progID
If (progID = "WMPlayer.OCX.7") Then
Set wmpObject = .OLEFormat.Object
End If
End If
End With
Next shp
end sub

Private Sub wmpObject_PlayStateChange(ByVal NewState As Long)
' LogIt "wmpObject_PlayStateChange: NewState = " & NewState & "."
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top