Jump to content
Sign in to follow this  

How to open different tabs in IE?

Recommended Posts


I have a urls listed in the notepad. I want to these urls in the IE browser open in different tabs.

Can some one tell me how to open in different tabs?


Aruna Chandu

Share this post

Link to post
Share on other sites

Hello arunachandu,

Try the following:

#include <IE.au3>

$oIE = _IECreate("www.autoitscript.com")
__IENavigate($oIE, "www.google.com", 0, 0x800)
__IENavigate($oIE, "www.gmail.com", 0, 0x800)
__IENavigate($oIE, "www.ebay.com", 0, 0x800

Please note that there are two underscores for the __IENavigate() function and that from what I can tell it is still being developed (it's an unsupported feature of AutoIt).

The documentation for the function is below:

; Function Name:    __IENavigate()
; Description:      ** Unsupported version of _IENavigate (note second underscore in name)
;                   ** Last 4 parameters insufficiently tested.
;                   **  - Flags and Target can create new windows and new browser object - causing confusion
;                   **  - Postdata needs SAFEARRAY and we have no way to create one
;                   Directs an existing browser window to navigate to the specified URL
; Parameter(s):     $o_object       - Object variable of an InternetExplorer.Application, Window or Frame object
;                   $s_Url          - URL to navigate to (e.g. "http://www.autoitscript.com")
;                   $f_wait         - Optional: specifies whether to wait for page to load before returning
;                                       0 = Return immediately, not waiting for page to load
;                                       1 = (Default) Wait for page load to complete before returning
;                   $i_flags        - URL to navigate to (e.g. "http://www.autoitscript.com")
;                   $s_target       - URL to navigate to (e.g. "http://www.autoitscript.com")
;                   $spostdata      - URL to navigate to (e.g. "http://www.autoitscript.com")
;                   $s_headers      - URL to navigate to (e.g. "http://www.autoitscript.com")
; Requirement(s):   AutoIt3 V3.2 or higher
; Return Value(s):  On Success  - Returns -1
;                  On Failure   - Returns 0 and sets @ERROR
;                   @ERROR      - 0 ($_IEStatus_Success) = No Error
;                               - 1 ($_IEStatus_GeneralError) = General Error
;                               - 3 ($_IEStatus_InvalidDataType) = Invalid Data Type
;                               - 4 ($_IEStatus_InvalidObjectType) = Invalid Object Type
;                               - 6 ($_IEStatus_LoadWaitTimeout) = Load Wait Timeout
;                               - 8 ($_IEStatus_AccessIsDenied) = Access Is Denied
;                               - 9 ($_IEStatus_ClientDisconnected) = Client Disconnected
;                   @Extended   - Contains invalid parameter number
; Author(s):        Dale Hohm
; http://msdn.microsoft.com/workshop/brows.../reference/enums/browsernavcon
; Flags:
;   navOpenInNewWindow = 0x1,
;   navNoHistory = 0x2,
;   navNoReadFromCache = 0x4,
;   navNoWriteToCache = 0x8,
;   navAllowAutosearch = 0x10,
;   navBrowserBar = 0x20,
;   navHyperlink = 0x40,
;   navEnforceRestricted = 0x80,
;   navNewWindowsManaged = 0x0100,
;   navUntrustedForDownload = 0x0200,
;   navTrustedForActiveX = 0x0400,
;   navOpenInNewTab = 0x0800,
;   navOpenInBackgroundTab = 0x1000,
;   navKeepWordWheelText = 0x2000

From what I gather, the reason for it being unsupported is that M$ doesn't want any of your IE tabs being hijacked from a naughty script running in a tab.

Also I think you can use _IEAttach to navigate between the tabs (I haven't tested this).

Good luck and please let me know how you get on :-)

Edited by icu

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...