i know you can hook browsers into a window using the windows internet component etc.
But is it possible to check if theres certain text on the page in this browser?
Printable View
i know you can hook browsers into a window using the windows internet component etc.
But is it possible to check if theres certain text on the page in this browser?
add a reference to the Microsoft Internt Controls
VB Code:
Dim WithEvents IE As InternetExplorer Private Sub Form_Load() Set IE = New InternetExplorer IE.Visible = True IE.Navigate "http://www.vbforums.com" End Sub Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant) If (pDisp Is IE.Application) Then Doc = IE.Document.Documentelement.innertext If InStr(Doc, "Classic Visual Basic") Then MsgBox "Its there!" Debug.Print Doc End If End If End Sub
after u get the messagebox, look in your debug (Immediate) window.. all text will be there ;)
thank you very much, but what do i change if i used the component on the form, instead of the references
thanks i just tried your code and it works. but it opens the actual webpage, is this possible to do using the webbrowser component instead?
Thanks for all your help and replies so far, much appreciated.
sure
remove the dim withevents IE line
remove the Set IE = line
change IE to the name of your webbrowser control
thanks alot mate, it works perfectly.
No problem! Glad to help
(Mark the thread resolved ;) go to the top -> Thread Tools ->Mark Resolved)