Jump to content
Esquared

How to open a new tab in an exsisting IE Window

Recommended Posts

Esquared

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!

Thanks

Share this post


Link to post
Share on other sites
KSum

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

Karl

Edited by KSum

Share this post


Link to post
Share on other sites
DW1

#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)

From

Share this post


Link to post
Share on other sites
JLogan3o13

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

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Esquared

@KSum - That's a good idea, I'll look through the shortcuts and see what I can dig up.

Thanks for you help!

Share this post


Link to post
Share on other sites
Esquared

@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.

Thanks,

Share this post


Link to post
Share on other sites
DW1

did you even try it with IEattach? Works fine for me, don't know why it wouldn't for you:

#include <IE.au3>
$oIE = _IEAttach("", "instance")
__IENavigate($oIE, "www.google.com", 0, 0x800)
__IENavigate($oIE, "www.gmail.com", 0, 0x800)
__IENavigate($oIE, "www.ebay.com", 0, 0x800)

Share this post


Link to post
Share on other sites
Chiquita78

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
               Else
                  $finalticket = $miscTicket
                  EndIf
               ExitLoop
            EndIf
      Next
      MsgBox(0,"func tab","IN function TAb line 355 ")
      $ntm = __IENavigate($tabopen, "http://sudnp01h.qintra.com/cgi-bin/QC/DSL/viewNTMTicketForm.pl", 0, 0x800)
      _IELoadWait($tabopen)
      MsgBox($MB_SYSTEMMODAL, "", "The $finalticket is: " & $finalticket)
      Local $NTMticket = _IEGetObjByName($ntm, "ntmTicket")


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

      Send ("{ENTER}")
      EndFunc
 

Edited by Chiquita78
Putting all code.

Share this post


Link to post
Share on other sites
Juvigy

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.

 

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

×