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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 Open IE at URL? 1

Status
Not open for further replies.

jasonp45

Programmer
Aug 23, 2001
212
US
What I want to do is, from within my VB(6) code, open up IE at a particular URL. It seems like the VBRun.Hyperlink object has this capacity, but I can't seem to instantiate the object; ditto for the 'UserDocument' object. Can I Shell to IE with a URL specification? If anyone can tell me the best way to do this I sure would appreciate it.
 
Code:
Private 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
Const SW_SHOWNORMAL = 1

Private Sub Form_Load()
    ShellExecute Me.hwnd, vbNullString, _ 
       "[URL unfurl="true"]http://www.Tek-Tips.com",[/URL] _ 
       vbNullString, "C:\", _ 
       SW_SHOWNORMAL
End Sub
That oughta do it.

VCA.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top