Solved

open new bowser window  from vb

Posted on 2001-09-12
11
249 Views
Last Modified: 2010-08-05
I opened a browser window using the foll. statement.

Shell "start.exe http://..w.html", vbHide

It works good.
    What's my problem is the above command opens a new browser window say IE when no other IE opened. But If I already opened IE for some other purpose, When I execute the above command It doesnt open new IE. instead of that it opens in the existing IE.
   I'd like to open a new IE even another IE opened.
   Please Guide me.
0
Comment
Question by:MuruganEE
  • 3
  • 2
  • 2
  • +4
11 Comments
 

Author Comment

by:MuruganEE
ID: 6478613
thanks
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6478626
Hi!

Do something like:

Shell "C:\IEFolder\IE.exe http://..w.html"

Wheere C:\IEFolder\IE.exe is the file path cum name of the IE exe file.

That's it!

glass cookie : )

0
 
LVL 51

Expert Comment

by:Ryan Chong
ID: 6478692
Hi MuruganEE,

Try this: ?


'! Open File with File Association
Public 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
Public Declare Function GetDesktopWindow Lib "user32" () As Long
'! Open File with File Association

Public Function StartDoc(ByVal FileName As String) As Long
    Dim Scr_hDC As Long
    Scr_hDC = GetDesktopWindow()
    'change "Open" to "Explore" to bring up file explorer
    StartDoc = ShellExecute(Scr_hDC, "Open", FileName, "", "C:\", 1)
End Function


'Hope will help.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Expert Comment

by:ture
ID: 6478854
But... "Bowser"... isn't that a character in the Super Mario games? What does he have to do with this VB code?

:o)

/Ture
0
 

Author Comment

by:MuruganEE
ID: 6478964
Hi ryancys ,
   Your method works like same as  
Shell "start.exe http://..w.html", vbHide
   Your md opens in the existing IE window, not in new window.
    thanks . keep mailing.
************************************
Hi glass_cookie,
    If I use this one I need to pick IExplore.exe path.
That is to be matched for every system.
I cant give "c:\file.." explicitely.
    thanks . keep mailing.
0
 
LVL 1

Expert Comment

by:gegege
ID: 6479113
if you read the registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IE Setup\Setup\Path

then it will give you the path to IE so you don't have to hard code "C:\program files\Internet Explorer"

The exe is always called iexplore.exe so just add that to the path.  Then use  glass_cookie's suggestion.



ed
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 6479245
"Starting Specified URLs in Separate Instances of the Default Browser"
http://www.mvps.org/vbnet/index.html?code/fileapi/browserstart.htm
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6481296
Hi!

Use this code:

Download...
http://www.vb-helper.com/HowTo/getassoc.zip
Description: Find the program associated with a file extension (3K)

That's it!

glass cookie : )
0
 
LVL 8

Accepted Solution

by:
glass_cookie earned 50 total points
ID: 6481302
Hi1

Here's another one:

Download...
http://www.planetsourcecode.com/vb/scripts/ShowZip.asp?lngWId=1&lngCodeId=8661&strZipAccessCode=soUt86610172

Description: This code enables you to list all file extensions in your machine which have registered file associations. The list will show what application title each file extension belongs to, what program execution command it is associated with, as well as the icons used. With this program, you can view, add and remove file associations, with ease and elegance. The application also provides a system tray function.


Snapshot:
http://www.planetsourcecode.com/xq/ASP/txtCodeId.8661/lngWId.1/qx/vb/scripts/ShowCode.htm

Just in case the above code doesn't return the path, only the name (unable to test it).

That's it!

glass cookie : )
0
 
LVL 3

Expert Comment

by:modder
ID: 6536282
MuruganEE

Please finalise this question, even if nobody gave you a satisfactory answer - in that case just let me know and I will be happy to refund your points to you.

If someone did give you a satisfactory answer, please accept the comment as the answer. If you are having problems doing that let me know.

Please do *not* ignore this request. To the other participants in the thread - if no response is forthcoming alert me and I will take action.

Regards

modder
Community Support Admin
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 6536511
"Starting Specified URLs in Separate Instances of the Default Browser"
http://www.mvps.org/vbnet/index.html?code/fileapi/browserstart.htm 


I believe answered the user's question exactly
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

749 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