Excel 2010 VBA用户表单嵌入YouTube视频 [英] excel 2010 vba user form embed youtube video

查看:149
本文介绍了Excel 2010 VBA用户表单嵌入YouTube视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找到一种将视频嵌入到Excel VBA中的用户窗体中的方法,但是即时通讯面临的问题是,根据某些网站的介绍,您需要添加"Shockwave Flash Object"控件并使用它将youtube视频嵌入到用户表单中,但是我似乎在其他控件列表中找不到Shockwave Flash对象.我需要补充一些参考吗?还是有一种更简单的方法将youtube视频嵌入到用户表单中?

i'm trying to figure out a way to embed a video into a user form in Excel VBA, but the issue that im facing is that, according to some sites, that you need to add the "Shockwave Flash Object" control and use it to embed the youtube video into a user form, but I can't seem to find the Shockwave Flash Object in the additional controls list. Is there some reference that I need to add? Or is there an easier way to embed a youtube video into the user form?

推荐答案

好吧,我确实在列表中找到了该控件,然后它的工作原理如下:

Well I did find that control in the list and then it works just like that:

Private Sub CommandButton1_Click()
    With Me.ShockwaveFlash1
        .LoadMovie 0, "http://www.youtube.com/v/jmHkMsrycBw"
    End With
End Sub

但是,如果需要替代方法,则可以在Webbrowser控件(控件列表中的"Microsoft Web浏览器")上显示嵌入式对象.

But if you need an alternative, you can display an embedded object on a Webbrowser control ('Microsoft Web Browser' in the controls list).

Private Sub CommandButton2_Click()
  With WebBrowser1
        .Navigate2 "about:" & _
            "<body style=""margin:0px;padding:0px"">" & _
            "<object width=""100%"" height=""100%"" type=""application/x-shockwave-flash"" data=""http://www.youtube.com/v/jmHkMsrycBw&amp;hl=de&amp;fs=1&amp;color1=0x3a3a3a&amp;color2=0x999999&amp;border=1"">" & _
            "<param name=""movie"" value=""http://www.youtube.com/v/jmHkMsrycBw&amp;hl=de&amp;fs=1&amp;color1=0x3a3a3a&amp;color2=0x999999&amp;border=1"" />" & _
            "<param name=""allowFullScreen"" value=""true"" />" & _
            "</object></body>"
    End With
End Sub

有关嵌入代码的更多信息:
https://developers.google.com/youtube/player_parameters

More Info on embedding code:
https://developers.google.com/youtube/player_parameters

这篇关于Excel 2010 VBA用户表单嵌入YouTube视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆