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

launch browser

Status
Not open for further replies.

greenhorn

Programmer
Joined
Apr 19, 2001
Messages
8
Location
CA
how can I launch a browser by clicking on a text box with an internet address in it and it takes me to that address??
 
You could try this

Call Shell("start " + text1.text, vbHide)

or

go through the the shell32.dll with

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

Matt




 

place this declaration in the general area


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

in the click event of the textbox place this code
replacing the txt.text with you text box value


ShellExecute(Me.hwnd, "open", txt.text, "", 0, SW_SHOWNORMAL)


Success!
::-)
 
this is the error I get when i put the code in SDH:
Function call on left side of assignment must return Variant or Object.
Can you help?
 
what is me.hwnd it doesn't work in outlook

LikeThisName <- ? Sorry It's Taken =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top