找回密码
 加入
搜索
查看: 4568|回复: 4

[IE类操作] 【已解决】vbs 如何实现 autoit 的_IEAttach功能

[复制链接]
发表于 2014-6-5 19:33:54 | 显示全部楼层 |阅读模式
本帖最后由 bin123485 于 2014-6-5 22:23 编辑
#include <IE.au3>
Local $oIE = _IEAttach("百度搜索")
请问用vbs怎样实现这样的功能?谢谢
发表于 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
这样试下
 楼主| 发表于 2014-6-5 21:30:23 | 显示全部楼层
回复 2# kevinch


    出错了。“对象不支持此属性或方法:'owin.document.title' "
发表于 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
你有打开的资源管理器或者文件夹页面,加个判断就行了
 楼主| 发表于 2014-6-5 22:08:49 | 显示全部楼层
本帖最后由 bin123485 于 2014-6-5 22:22 编辑

回复 4# kevinch


   这下终于成功了,thank you very much!!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-3 04:35 , Processed in 0.078625 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表