|
-
Dec 5th, 2000, 10:06 AM
#1
Thread Starter
New Member
Hi Guys,
I am new to VB. I got an VBA application wizard where I put the image control. When I click that image it needs to open the web browser and go to that url address. Can anybody help in writing this code?
Thanks
-
Dec 6th, 2000, 01:56 AM
#2
very simple
Just code this at click event of image
Shell "C:\Program Files\Plus!\Microsoft Internet\IEXPLORE.EXE http://www.microsoft.com", vbMaximizedFocus
-
Dec 6th, 2000, 07:06 AM
#3
Addicted Member
'Declare this in modules
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
'Use this procedure
Public Sub Link2Net(Address As String)
' Starts the default browser and Address as specified in the argument "Address"
Dim iret As Long
iret = ShellExecute(Form1.hwnd, vbNullString, _
Address, vbNullString, "c:\", SW_SHOWNORMAL)
End Sub
'Example
'on the click event of the image control
Call Link2Net("http://members.fortunecity.com/rbnwares1")
'It will automatically launch the default browser with the supplied address
 Stupidity is better than cure.
VB6 SP5 Enterprise Ed.
C, Pascal, VC++ 6.0
Running Win98 SE and Win2000 Prof. Ed.
Email me at : [email protected]
-
Dec 6th, 2000, 09:17 AM
#4
Thread Starter
New Member
Thanks
Thanks for the replies Guys.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|