Click to See Complete Forum and Search --> : Open Internet Site
I have created an ABOUT BOX for my new program, and have created a command button which, when clicked, I would like it to open a web page. Does anyone know what code I would use?
Please help - I am a COMPLETE beginner!
Arsalan
May 24th, 2000, 12:55 PM
Use shell function.
Like
shell("c:\windows\explorer http://" & mysite) ' where mysite is any valid url
Hope it will solve your problem
e-mail : arsalan_aslam@hotmail.com
ckaminski
May 24th, 2000, 01:08 PM
A slightly better approach would be to use the ShellExecute API, because it understands file associations, it will open whichever browser a user has as the default browser.
Place the following code in the General Declarations of a module:
Public 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
Public Const SW_SHOW = 5
Then open the URL like this:
ShellExecute 0, "open", "http://www.yahoo.com", vbNullString, vbNullString, SW_SHOW
Hope this helps,
Chris
Chris Eastwood
May 24th, 2000, 02:12 PM
You can use the control from :
http://codeguru.developer.com/vb/articles/2070.shtml
- it wraps up all the shellexecute api calls for you and allows you to specify 'behaviour' of the 'url' - all the source code and a sample project is included.
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
sathercj
May 24th, 2000, 08:07 PM
Very thorough job! Congratulations on a masterful piece of work! I have been researching a
similar question, and this showed me how much was involved.
Thanks.
Cliff Sather
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.