Jump to content

How to open a new tab in an exsisting IE Window

Recommended Posts

What I'm tring to do is open a new tab in a pre-existing Internet Explorer window. What I have is an internal web application I want to be able to start and log in to from the favorite bar in IE. The reason I want to do it is beacuse it times out all the time and if I have it in my favorite bar I can just click on it and it'll log me back in again. I cann't use _IECreate because it opens up a new window, not what I want when the current tab is timed out.

I tried using this script but it just takes over the last used tab I was on.

include <IE.au3>

$oIE = _IEAttach("", "instance")

_IENavigate($oIE, "www.google.com")

If anyone has any idea's, I'd love to hear them!


Link to post
Share on other sites

Have you tried sending a keystroke. A full list of them for IE can be found here: http://windows.microsoft.com/en-US/windows7/Internet-Explorer-keyboard-shortcuts Expand the "Working with tabs" section. Here are what may be the key ones:

Ctrl+click - Open links in a new tab in the background

Ctrl+Shift+click - Open links in a new tab in the foreground

Ctrl+T - Open a new tab in the foreground

Ctrl+Tab or Ctrl+Shift+Tab - Switch between tabs

Ctrl+W - Close current tab (or the current window if tabbed browsing is disabled)

Alt+Enter - Open a new tab in the foreground from the Address bar


Edited by KSum
Link to post
Share on other sites
  • Moderators

Hi, Esquared, have you done a search of the forum yet? A quick search of "open new tab" pulled up a NUMBER of posts. Here is just one example...

@danwilli - beat me to it :oops:

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to post
Share on other sites

@danwilli & @JLogan3013 - The code you listed doesn't work for me.

[ autoIt ]    ( Popup )
#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)

I'm tring to create an new tab in an already exsisting IE window. As soon as you include _IECreate, it creates a new IE window and goes to that location. I need it to be in an already exsisting IE window.


Link to post
Share on other sites
  • 5 years later...

I was wondering if someone could help me with an issue.  To give some information I'm am opening multiple windows that will display information that needs to be reviewed.  Each ticket that I open will have a separate window and a tab window for me to enter the ticket number to be reviewed. MY issue is, I am able to open IE and bring up the initial window and a tab window to where all I need to do now is enter the ticket.  However, I cannot focus on the tab page that is opening b/c I use _IENavigate.  In addition, there are approximately 10 of these windows with a tab window open as well.   Below is where I have open the tab but what I'm trying to do is put the ticket number in the tab that was just open. If I use _IEattach it focuses on the very first tab that was open.  IS there a way I can focus on the tab page that was just open in the program?


   Func Tab($i)

      Local $ticketTemp1 =""
      Local $ticketTemp2 =""
      Global $ocodes = _IETagNameAllGetCollection($tabopen)

      For $ocode In $ocodes

            If $ocode.id == 'Content' Then

               $ticketTemp1 = StringInStr($ocode.innerText, "ERIC ID")
               $ticketTemp2 = StringInStr($ocode.innerText, "Misc Ticket")
               Global $miscTicket = StringMid($ocode.innerText,$ticketTemp2+10, 16)
               Global $ericTicket = StringMid($ocode.innerText,$ticketTemp1+7, 16)
               if  StringInStr($miscTicket , 'Escalated') Then
                  Global $finalticket = $ericTicket
                  $finalticket = $miscTicket
      MsgBox(0,"func tab","IN function TAb line 355 ")
      $ntm = __IENavigate($tabopen, "http://sudnp01h.qintra.com/cgi-bin/QC/DSL/viewNTMTicketForm.pl", 0, 0x800)
      MsgBox($MB_SYSTEMMODAL, "", "The $finalticket is: " & $finalticket)
      Local $NTMticket = _IEGetObjByName($ntm, "ntmTicket")

      _IEPropertySet($ntm, 'innertext', $finalticket)

      Send ("{ENTER}")

Edited by Chiquita78
Putting all code.
Link to post
Share on other sites

Hi Chiquita,

You should open an separate topic for your issue and not use random very old ones. Regarding your issue - you should check if your object $ntm is OK.

For example check if the object points to the correct tab with the correct html address.


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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...