Chiquita78

How to open a new tab in an exsisting IE Window

7 posts in this topic

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 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.  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 ")
       __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

Share this post


Link to post
Share on other sites



Suggest that you review this thread

P.S. Welcome to the forums!

Share this post


Link to post
Share on other sites

I think you are confusing ntm with tabopen . I think you want to use tabopen on this line instead of ntm, right?

: Local $NTMticket = _IEGetObjByName($ntm, "ntmTicket")

Share this post


Link to post
Share on other sites
2 hours ago, Juvigy said:

I think you are confusing ntm with tabopen . I think you want to use tabopen on this line instead of ntm, right?

: Local $NTMticket = _IEGetObjByName($ntm, "ntmTicket")

I don't believe that will work either since $tabopen still points to the original tab, not the new one.

Read the link I posted above for more info.

Share this post


Link to post
Share on other sites

I already suggested Chiquita to use IEAttach in another tread and i assume she had.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

The programs creates a loop and open multiple windows to the same website.  The website I open only has a place to just enter ticket number and submit.  So when I do IEattach instead of attaching to the tab I just open. It attaches to the very first webiste that was open with the orginal tab.  So my problem is I can't IEattch to the last tab.  If that doesn't make sense please let me know.

Want to say thank you for you help with this mater.

Edited by Chiquita78
Spelling error

Share this post


Link to post
Share on other sites

You can use $sMode of "instance" and then loop through the available instances. Look at the last example under _IEAttach in the help file.

You'll likely need to use that in combination with _IEPropertyGet to match up by the URL.

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