Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way to embed a YouTube video in my Access form? 1

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I am making a database to play movies and want to get the trailer from YouTube.com if available. I am launching the YouTube site now but thought it would be cool if it was embedded in my form.
I see on you tubes web site there is html but not sure how to make it into VBA.
Code:
<object width="425" height="344"><param name="movie" value="[URL unfurl="true"]http://www.youtube.com/v/IvNkGm8mxiM&hl=en&fs=1"></param><param[/URL] name="allowFullScreen" value="true"></param><embed src="[URL unfurl="true"]http://www.youtube.com/v/IvNkGm8mxiM&hl=en&fs=1"[/URL] type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>

here my code to launch YouTube
Code:
   Dim GoInternet, SearchString As String
    GoInternet = "[URL unfurl="true"]http://www.youtube.com/results?search_query="[/URL]
    'SearchString =
    GoInternet = GoInternet & Replace(Me.Text12, " ", "+")
    GoInternet = GoInternet & "&search_type=&aq=f"
    ProcessId = ShellExecute(Me.hwnd, "open", GoInternet, "", "", 0)

TIA

DougP
 
Hi DougP,

I haven't spent much time on this...busy at work ;)
but you might want to look at adding a web browser control to your form.

Private Sub Form_Load()
Dim strURL As String
Dim objIE As Object

strURL = "Set objIE = Me.WebBrowser0.Object

objIE.Navigate strURL

End Sub

Not sure how you would go about only displaying the vid though...

Hope this is some help for you.

Regards,

Peter.

Remember- It's nice to be important,
but it's important to be nice :)
 
Great it does work, but shows the entire web page.

for anyone interested on the tool box, I click the "More controls" then choose the "Microsoft WEB Browser" from the list.

DougP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top