Opening a new internet explorer window

tk.unlimited

Active member
Joined
Apr 2, 2005
Messages
27
Programming Experience
1-3
Hey all!!
I just want to know how to open a new Internet Explorer Browser window. The scenario is as so:
User inputs date (i.e January 2005) the program searches the database and returns all the dates with January 2005. I want the Internet Explorer browser to open when a button is clicked.. and when the user input changes and button pressed again, Want the browser to REFRESH.. Any ideas?? :confused:
 
You can use Process.Start to start any program, including IE. If you want to open an IE window with the default home page you would use:
VB.NET:
Process.Start("iexplore")
If you want to open a URL in a new IE window you would use something like:
VB.NET:
Process.Start("iexplore", "www.google.com")
If you want to open a URL in the user's default browser, which is more polite (I use FireFox for a reason), you would use something like:
VB.NET:
Process.Start("www.google.com")
When opening IE this way you will always get a new window. I'm not exactly sure how you would refresh an existing window, but i'd say that your choices would be to use APIs or to automate IE rather than starting a new process. I'm sure MSDN will have plenty of information on the IE object model, just like automating Office apps.
 
Just a point of clarification. If IE is your default browser and you call Process.Start and pass it only a URL, its behaviour depends on the "Reuse windows for launching shortcuts" option on the Advanced tab of the Internet Options dialogue. If that option is ticked then a current window will used to display the new URL if one is open. If that option is not ticked then a new window will always be opened for the new URL whether there is already a window open or not.
 
Back
Top