Solved

open new bowser window  from vb

Posted on 2001-09-12
11
243 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 49

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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB 6.0 printer how to align 6 58
Run code from text file in vb 1 56
How to produce a SHA-1 hash function in vb6 in order to save it to a table 8 36
Child Form in front 4 38
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now