How do I create a button in my application that when pressed, it opens that url in the
default web browser? I know it is probably
simple, but I need help.
Printable View
How do I create a button in my application that when pressed, it opens that url in the
default web browser? I know it is probably
simple, but I need help.
Hey- the code is
Shell "start <A HREF="http://www.PageToOpen.com"" TARGET=_blank>www.PageToOpen.com"</A>
note: i dont think this works on NT
Thnx for your time,
CarlosTheJackal
What you really want to use is the ShellExecute API call. It looks like this:
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
Use it like this to launch a web url:
Call ShellExecute(0&, vbNullString, "http://www.vbsquare.com/", vbNullString, vbNullString, vbNormalFocus)
------------------
"To the glory of God!"