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
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.