bin123485 发表于 2014-6-5 19:33:54

【已解决】vbs 如何实现 autoit 的_IEAttach功能

本帖最后由 bin123485 于 2014-6-5 22:23 编辑


#include <IE.au3>
Local $oIE = _IEAttach("百度搜索")
请问用vbs怎样实现这样的功能?谢谢

kevinch 发表于 2014-6-5 20:34:09

set shell=createobject("shell.application")
found=false
for each owin in shell.windows
    if owin.document.title="百度一下,你就知道" then
      found=true
      exit for
    end if
next
if found then
    msgbox "OK"
else
    msgbox "No"
end if这样试下

bin123485 发表于 2014-6-5 21:30:23

回复 2# kevinch


    出错了。“对象不支持此属性或方法:'owin.document.title' "

kevinch 发表于 2014-6-5 21:47:07

set shell=createobject("shell.application")
found=false
for each owin in shell.windows
    if typename(owin.document)="HTMLDocument" then
      if owin.document.title="百度一下,你就知道" then
            found=true
            exit for
      end if
    end if
next
if found then
    msgbox "OK"
else
    msgbox "No"
end if你有打开的资源管理器或者文件夹页面,加个判断就行了

bin123485 发表于 2014-6-5 22:08:49

本帖最后由 bin123485 于 2014-6-5 22:22 编辑

回复 4# kevinch


   这下终于成功了,thank you very much!!
页: [1]
查看完整版本: 【已解决】vbs 如何实现 autoit 的_IEAttach功能