Solved

open new bowser window  from vb

Posted on 2001-09-12
11
252 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
[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
  • 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 52

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
Independent Software Vendors: 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

688 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