VBScript to Select a Specific Tab in IE7

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

VBScript to Select a Specific Tab in IE7

Post by armsys » Tue Apr 22, 2008 3:51 am

Within an IE7 window, there are 30 tabls opening. The positions of the tabs are dynamically moving. Then, how to write a (VB)script to SetFocus to a specific tab, say, http://www.yahoo.com, amongst the 30 tabs?
Thanks.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Apr 24, 2008 9:16 am

I don't believe there is a way to script selecting a tab. The DOM scripting relates to scripting the html within the browser document, but not scripting the IE7 container application.

I think what I would do is use CTRL-TAB to go to the next tab, and then send ALT-D to put the cursor in the URL bar, then grab the URL to the clipboard. Using this method you could make a loop which keeps pressing CTRL-TAB until the desired page is the current one.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts