|
-
Sep 14th, 2005, 06:06 AM
#1
Thread Starter
Frenzied Member
browser component question
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?
-
Sep 14th, 2005, 07:27 AM
#2
Re: browser component question
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
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Sep 14th, 2005, 12:28 PM
#3
Thread Starter
Frenzied Member
Re: browser component question
thank you very much, but what do i change if i used the component on the form, instead of the references
-
Sep 14th, 2005, 12:31 PM
#4
Thread Starter
Frenzied Member
Re: browser component question
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.
-
Sep 14th, 2005, 02:53 PM
#5
Re: browser component question
sure
remove the dim withevents IE line
remove the Set IE = line
change IE to the name of your webbrowser control
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Sep 15th, 2005, 04:58 AM
#6
Thread Starter
Frenzied Member
Re: browser component question
thanks alot mate, it works perfectly.
-
Sep 15th, 2005, 09:31 AM
#7
Re: browser component question
No problem! Glad to help
(Mark the thread resolved go to the top -> Thread Tools ->Mark Resolved)
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|