Open IE with multiple tabs

允我心安 提交于 2020-01-30 08:48:27

问题


I'm trying to create an AutoHotkey script that can be added to the Startup folder, to open IE with multiple predetermined tabs. I have several websites at work that I use regularly, & I want to have IE automatically open when I first login with these pages loaded. I've searched & found a few AHKs which I've tried to alter for my needs, but I receive errors with them. Here is the code I'm trying to use:

Pwb :=  COM_CreateObject ("InternetExplorer.Application")
Pwb.Visible:=True
Pwb.Navigate("https://*****.org/***/") 
Pwb.Navigate2("https://*****", 2048)
Pwb.Navigate3("http://*****", 2048)
Pwb.Navigate4("http://*****", 2048)
Pwb.Navigate5("*****", 2048)
Pwb.Navigate6("*****", 2048)
Return

When I launch this I receive error "The following variable name contains an illegal character: "Pwb.Visible" The program will exit." If I try to just delete that part of the code, I then get errors on my websites: "Error: Call to nonexistent function. Specifically: Pwb.Navigate("https://.org/**/") The program will exit."


回答1:


Try this. Make sure you have the latest version of AutoHotkey (v1.1+). COM_CreateObject() should be ComObjCreate() and there are no Navigate3, Navigate4, or Navigate5... methods available in that object.

Pwb :=  ComObjCreate("InternetExplorer.Application")
Pwb.Visible:=True
Pwb.Navigate("http://www.google.com") 
Pwb.Navigate("http://stackoverflow.com", 2048)
Pwb.Navigate("http://news.google.com", 2048)
Pwb.Navigate("https://www.quora.com/", 2048)
Return


来源:https://stackoverflow.com/questions/13567780/open-ie-with-multiple-tabs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!