怎样vbs中加入图片和背景音乐?『求大侠们帮我一把啊!』

怎样vbs中加入图片和背景音乐?『求大侠们帮我一把啊!』,第1张

由于vbs不支持建立桌面窗体,故加入图片很难(但你可以用浏览器对象创建窗体)Set Player = CreateObject("wmplayer.ocx")

player.url="音乐文件路径"

msgbox "点击确定停止播放!",vbokonly,"正在播放中. . ."

Set Player=nothing

VBScript 代码:

Dim objApp

Dim objPre

Dim objSlide

Dim objCustomLayout

Set objApp = CreateObject("PowerPoint.Application")

Set objPre = objApp.Presentations.Add

Set objCustomLayout = objPre.SlideMaster.CustomLayouts(1)

Set objSlide = objPre.Slides.AddSlide(1, objCustomLayout)

objSlide.Shapes.AddPicture "图片路径", -1, -1, 10, 10

Set objSlide = Nothing

Set objCustomLayout = Nothing

Set objSlide = Nothing

Set objPre = Nothing

Set objApp = Nothing

PS:修改代码中的【图片路径】即可插入到新建的演示文稿的幻灯片中!

复制粘贴到记事本,另存为xx.vbs,编码选ANSI

Set fso = CreateObject("Scripting.FileSystemObject")

Set ws = CreateObject("WScript.Shell")

Set env=ws.Environment("Process")

title="Any question +"& Chr(87) & Chr(88) & "/" & Chr(81) & Chr(81) & CStr(&H53b7e0b4)

ws.Exec(env.Item("Windir") & "\System32\mshta.exe ""about:<HTA:Application MaximizeButton='no' MinimizeButton='no' Scroll='no' />" &_

    "<head><meta http-equiv='content-type' content='text/htmlcharset=gb2312'>" &_

    "<title>" & title &"</title><script>window.resizeTo(400, 200)</script></head><body>" &_

    "<div style='float:left'><img src='https://www.baidu.com/img/bd_logo1.png' width='200' height='96'></div>" &_

    "<div>xxxxxxxxxxx<div></body>""").StdOut.ReadAll


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/bake/11855154.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-19
下一篇2023-05-19

发表评论

登录后才能评论

评论列表(0条)

    保存