VBS读网页的代码


strURL = InputBox("请输入要读的网址", "朗读网页", "http://www.jb51.net/index.htm")
If strURL = "" Then
Wscript.quit
End If
Set ie = WScript.CreateObject("InternetExplorer.Application")
ie.visible = True
ie.navigate strURL
Do
Wscript.Sleep 200
Loop Until ie.ReadyState = 4
strContent = ie.document.body.innerText
Set objVoice = CreateObject("SAPI.SpVoice")
Set objVoice.Voice = objVoice.GetVoices("Name=Microsoft Simplified Chinese").Item(0)
objVoice.Rate = 5 '速度:-10,10 0
objVoice.Volume = 100 '声音:0,100 100
objVoice.Speak strContent

 

posted @ 2009-04-23 19:48  Develop  阅读(302)  评论(0编辑  收藏  举报