ole 调用ie

integer result
oleobject objexplorer,iedoc
objexplorer = create oleobject
result = objexplorer.connecttonewobject( "internetexplorer.application")
if result = 0 then
 objexplorer.navigate("www.baidu.com")
 iedoc = objexplorer.document
 objexplorer.toolbar = 0
 objexplorer.statusbar =0
 objexplorer.width = 3000
 objexplorer.height = 1500
 objexplorer.left = 0
 objexplorer.top = 0
 objexplorer.visible = 1
end if

//调用js

oleobject wshshell
wshshell = create oleobject
wshshell.connecttonewobject( "wscript.shell")
integer li_return
li_return = wshshell.run("cscript e:\validate.js", 1, true)
messagebox("",li_return)
wshshell.disconnectobject ( )
destroy wshshell

//js格式

<script language=javascript>
 function showmessage(img_name)
 {
  alert(img_name);
 }
 </script>

posted @ 2016-06-01 09:09  figo361  阅读(236)  评论(0编辑  收藏  举报