Show hyperlink URL in status bar

Sample code to show a hyperlink's url or title in a status bar from webBrowser control.

LVL 11
Who is Participating?
Richie_SimonettiConnect With a Mentor IT OperationsCommented:
'set a reference to microsoft HTML object library

'declare a variable:
Private WithEvents hDoc As HTMLDocument

'on this event:
Private Sub WB1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is WB1.object) Then
    Set hDoc = WB1.Document
end if
end sub

'and in this event
Private Sub hDoc_onmousemove()
If hDoc.parentWindow.event.srcElement.tagName = "A" Then
    Me.Caption = hDoc.parentWindow.event.srcElement.href
End If
End Sub
Ryan ChongCommented:
Hi kmartin7,

Sometimes that may useful:

Receive Events from and Send Events to Open IE Windows (by Ark)
Richie_SimonettiIT OperationsCommented:
Thanks for "A" grade!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.