dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
610
share rss forum feed


tahoejeff
Premium
join:2001-07-01
Wisconsin Dells, WI

auto play hyperlinked video in PPT slide

Powerpoint 2007:
I have to hyperlink to a video on our corporate intranet page on one of the slides of my Powerpoint presentation. Not possible to download the actual video and embed it in the slide, for security reasons.
The video plays fine when my link is clicked, but I would like to have the video play automatically when the presenter gets to that slide.

My research shows that there is no macro recorder in this version of Powerpoint, but that I can still create one with VBA.
Would this be possible? What would the code look like? Possible to force it to play in a standalone Windows Media Player window instead of the default web browser?
I've also tried inserting a Windows Media Player Control, with the url pasted into the properties, but for some reason it doesn't play. The url ends with an aspx extension.
--
The Geek Shall Inherit the Earth


H2OuUp2
Happy to be here
Premium
join:2002-03-15
Oklahoma City, OK
Try this code, change the website and file name to match your needs. Put it in the


Dim myURL As String
myURL = "http://www.yoursite.com/file.csv"

Dim WinHttpReq As Object
Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
WinHttpReq.Open "GET", myURL, False
WinHttpReq.Send

myURL = WinHttpReq.ResponseBody
If WinHttpReq.Status = 200 Then
Set oStream = CreateObject("ADODB.Stream")
oStream.Open
oStream.Type = 1
oStream.Write WinHttpReq.ResponseBody
oStream.SaveToFile ("C:\file.csv")
oStream.Close
End If


You will need to add an Sub Auto_Open() - Which gets executed immediately after the presentation is opened, to point to this code, or just enter this in the Auto_Open.

I generally have the code as stand alone and have the Auto_Open refer to it, that way if I need to run it at another time I can.
--
He is no fool who gives up what he cannot keep, to gain what he cannot lose. - Jim Elliot