Results 1 to 2 of 2

Thread: Follow Hyperlink in Webbrowser1

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2000
    Location
    Atlanta, GA
    Posts
    177

    Follow Hyperlink in Webbrowser1

    Hello,

    I was wondering if any one knew how to detect the URL of a hyperlink that was clicked in the webbrowser1 control? Sort of like when you click on a hyperlink in IE the current URL shows up in the Address bar. So far I just keep getting the start URL.

    Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    MsgBox WebBrowser1.LocationURL
    End Sub
    212 will lead you to the truth

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Sep 2000
    Location
    Atlanta, GA
    Posts
    177

    Follow Hyperlink **RESOLVED**

    There were two problems the first of which was an error in the web page design

    In the web page I am using frames I had to set the target frame of the hyperlink to Whole Page

    the second problem was the code was placed in the wrong location:

    Private Sub WebBrowser1_TitleChange(ByVal Text As String)
    URL.Text = WebBrowser1.LocationURL
    URL.AddItem URL.Text
    If URL.Text = "https://www.msn.com" Then
    WebBrowser2.Navigate URL.Text
    WebBrowser1.GoBack
    End If
    End Sub

    I hope this helps someone. Happy coding.
    212 will lead you to the truth

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