Hi guys,
The webbrowser control is essentially IE without the container it is the part of IE that you view web pages in. It can be added to a VB project by adding the Microsoft Internet Control (shdocvw.dll)
PS. getting the current link under the mouse is not easy
especially not with VB. StatusTextChange sometimes is set by the web designer to show alternative text in the status bar. This would therefore cause a problem if you presumed all it is displaying is urls. Also trying to check if the statustext is a valid url can get intensive especially if the site designer has scrolling messages in the status bar.
There is another way to gain access to the Document object model of a web page in VB and that is by adding a reference to to shdocvw.dll (no need to add the component if you dont wont to display the actual web page). Then write the following ...
(createDocumentFromUrl is only available for IE5 and above)
Dim oMSHTML As New MSHTML.HTMLDocument
Dim oDocument As MSHTML.HTMLDocument
Set oDocument = objMSHTML.createDocumentFromUrl("
vbNullString)
While oDocument.readyState <> "COMPLETE"
DoEvents
Wend
debug.print "MY TITLE IS " & oDocument.title
replace "
with whatever link you want
PS. got that loop wrong in the previous post, it should be similar to ...
if oDocument.links.length > 0 then
for i = 0 to oDocument.links.length - 1
debug.print oDocument.links(i).href
next
end if