Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I start IE and go to a URL 3

Status
Not open for further replies.

dsi

Programmer
Mar 13, 2000
964
US
How can I start Internet Explorer, maximize it, and go to a specified URL? Any help would be greatly appreciated.<br><br>Thanks!
 
<br>This is one way to accomplish the task.<br><br>Private Const SW_SHOWNORMAL = 1<br><br>Private Declare Function ShellExecute Lib &quot;shell32.dll&quot; Alias &quot;ShellExecuteA&quot; (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<br><br>Private Sub main()<br><br>Dim sURL As String<br>Dim hInst As Long<br><br>sURL = &quot;<A HREF=" TARGET="_new"> = ShellExecute(hwnd, &quot;Open&quot;, sURL, vbNullString, vbNullString, SW_SHOWNORMAL)<br><br>End Sub<br>
 
VB400,<br><br>Isn't ShellExecute an available method with in VB, why do you need the dll to call it?<br><br>
 
You may be thinking of the Shell command. The ShellExecute command is from the Windows API. I have not tried this solution yet. Instead, I used the WebBrowser Control from the Microsoft Internet Controls component.
 
Here's a simple way to do this thing. The URL could easily have been a variable...so you could have a textbox where the user would enter and a command button and whalah.<br>Option Explicit<br>Dim ie As InternetExplorer<br><br>Private Sub Command1_Click()<br>Set ie = New InternetExplorer<br><br>ie.Visible = True<br>ie.AddressBar = True<br>ie.TheaterMode = False<br>ie.Navigate (&quot;<A HREF=" TARGET="_new"> Sub<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top