Private Sub currentWebBrowser_documentComplete(ByVal obj As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent) Dim doc As mshtml.IHTMLDocument2 = CType(currentWebBrowser.Document, mshtml.IHTMLDocument2) Dim anchors As mshtml.IHTMLElementCollection = doc.anchors
For Each elem As mshtml.IHTMLElement2 In anchors Dim htmlevents As mshtml.HTMLAnchorEvents2_Event = CType(elem, mshtml.HTMLAnchorEvents2_Event) AddHandler htmlevents.onclick, AddressOf anchor_onclick Next End Sub