Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Open New Internet Explorer Window

Posted on 2002-07-12
8
Medium Priority
?
187 Views
Last Modified: 2010-05-02
how can i programmatic browse to a specific web page in a NEW Internet Explorer window even if the user has there IE settings set to reuse IE windows?
0
Comment
Question by:Jambyte
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7148480
I use this code, which opens a new IE for me, even as i have configured to reuse IE windows:

Private Declare Function ShellExecute Lib _
              "shell32.dll" Alias "ShellExecuteA" _
              (ByVal hwnd As Long, _
               ByVal lpOperation As String, _
               ByVal lpFile As String, _
               ByVal lpParameters As String, _
               ByVal lpDirectory As String, _
               ByVal nShowCmd As Long) As Long
               
Private Const SW_SHOW = 1

Private Sub Navigate(ByVal NavTo As String)
  Dim hBrowse As Long
  hBrowse = ShellExecute(0&, "open", NavTo, "", "", SW_SHOW)
End Sub


CHeers
0
 
LVL 2

Expert Comment

by:priya_pbk
ID: 7148500
try this:

In windows 2000:-

Privat Sub command1_click()
Call Shell("C:/Program Files/Internet Explorer/iexplore.exe http://www.experts-exchange.com", vbNormalFocus)
End Sub

In others(like windows NT) etc

Privat Sub command1_click()
Call Shell("c:/program Files/Plus!/Microsoft Internet/iexplore.exe http://www.experts-exchange.com", vbNormalFocus)
End Sub

Hope this helps!

-priya


0
 
LVL 2

Author Comment

by:Jambyte
ID: 7148580
angelIII, your code seems to be the most elegent but it doesn't open a new window if reuse current IE window is enabled in windows xp IE6.

priya_pbk, is there a way to make new window be in front, be active, or have focus know what i mean?
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 2

Expert Comment

by:priya_pbk
ID: 7148617
Actually speaking, I did not have a good read at your question. I had just read the headline qt in the main page.

Again, the above code was for opening IE programatically thru vb (which i thought you wanted)!


if so, change the second parameter to "vbMinimizedFocus" instead of "vbNormalFocus", will this help!

-priya
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 7148989
Dim IE
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate strURL
0
 

Expert Comment

by:itmelo
ID: 7149259
I found this code in Microsoft's Knowledge Database some time ago and I use it quite a bit. It opens a new browser window even if others are open.

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q174156

Give it a try...

Private Const SW_SHOW = 5 ' Displays Window in its current size and position
Private Const SW_SHOWNORMAL = 1 ' Restores Window if Minimized or Maximized

Private Declare Function ShellExecute Lib "shell32.dll" Alias _
         "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As _
         String, ByVal lpFile As String, ByVal lpParameters As String, _
         ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Declare Function FindExecutable Lib "shell32.dll" Alias _
         "FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory As _
         String, ByVal lpResult As String) As Long

Private Sub Command1_Click()
      Dim FileName, Dummy As String
      Dim BrowserExec As String * 255
      Dim RetVal As Long
      Dim FileNumber As Integer

      ' First, create a known, temporary HTML file
      BrowserExec = Space(255)
      FileName = "C:\temphtm.HTM"
      FileNumber = FreeFile                    ' Get unused file number
      Open FileName For Output As #FileNumber  ' Create temp HTML file
          Write #FileNumber, "<HTML> <\HTML>"  ' Output text
      Close #FileNumber                        ' Close file
      ' Then find the application associated with it
      RetVal = FindExecutable(FileName, Dummy, BrowserExec)
      BrowserExec = Trim(BrowserExec)
      ' If an application is found, launch it!
      If RetVal <= 32 Or IsEmpty(BrowserExec) Then ' Error
          MsgBox "Could not find associated Browser", vbExclamation, _
            "Browser Not Found"
      Else
          RetVal = ShellExecute(Me.hwnd, "open", BrowserExec, _
            "www.microsoft.com", Dummy, SW_SHOWNORMAL)
          If RetVal <= 32 Then        ' Error
              MsgBox "Web Page not Opened", vbExclamation, "URL Failed"
          End If
      End If
      Kill FileName                   ' delete temp HTML file
End Sub
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8002363
Hi Jambyte,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Refund points and save as a 0-pt PAQ.

    *** NOTE: I thought that angelIII's techniqye should work, but if it doesn't than maybe AzraSound's  will also fail.  Can anyone say for sure?

Jambyte, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 8095354
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question