' References : Microsoft HTML Object Library (mshtml.tlb)
' Tryk CTRL+T og find Microsoft HTML Object Library på listen..
Option Explicit
Private WithEvents m_Document As HTMLDocument
Private Sub Form_Load()
With WebBrowser1 ' <- Microsoft Internet Controls
.Navigate "about:blank"
With .Document
.open
' Test link
.writeln "<a href=""config"">Config</a>"
.writeln "<a href=""
http://www.eksperten.dk/"">Eksperten</a>" .Close
End With
End With
End Sub
Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
If Not pDisp.Document Is Nothing Then
Set m_Document = pDisp.Document
End If
End Sub
Private Function m_Document_onclick() As Boolean
With m_Document.activeElement
If .tagName = "A" Then
If .href = "about:blankconfig" Then
Form2.Show vbModal, Me ' HER åbner din form2
Exit Function
End If
MsgBox "Gå til : " & .href
m_Document_onclick = True
End If
End With
End Function