Results 1 to 4 of 4

Thread: URL link with an Image control

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2000
    Location
    Raleigh
    Posts
    7

    Angry

    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

  2. #2
    Guest

    Wink very simple

    Just code this at click event of image

    Shell "C:\Program Files\Plus!\Microsoft Internet\IEXPLORE.EXE http://www.microsoft.com", vbMaximizedFocus

  3. #3
    Addicted Member rbnwares's Avatar
    Join Date
    Sep 2000
    Location
    Philippines
    Posts
    142

    Question

    '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]

  4. #4

    Thread Starter
    New Member
    Join Date
    Dec 2000
    Location
    Raleigh
    Posts
    7

    Smile 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
  •  



Click Here to Expand Forum to Full Width