|
-
Sep 9th, 2000, 10:53 AM
#1
I suppose you could use the SendKeys statement:
Code:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
WebBrowser1.SetFocus
SendKeys "^f", True 'popup the find dialog
SendKeys "TheTextToSearchFor", True 'fill the dialog
SendKeys "~", True 'do the first search
End Sub
Good luck!
-
Sep 9th, 2000, 11:01 AM
#2
Frenzied Member
If that doesn't work use this (you can make your own Find Dialog to fill in the Variables).
Code:
'Put an Internet Transfer Control (ITC) on your form
MyString = Inet1.OpenUrl("MYURL")
If Instr(1,MyString,"MYWORDTOSEEKFOR") <> 0 Then
MsgBOx "Found!"
Else
MsgBOx "Not in here!"
End If
'If you want it CaseInsensitive use:
MyString = Inet1.OpenUrl("MYURL")
If Instr(1,Lcase(MyString),Lcase(MYWORDsTOSEEKFOR)) <> 0 Then
MsgBOx "Found!"
Else
MsgBOx "Not in here!"
End If
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Sep 9th, 2000, 11:24 AM
#3
I just wanted to point out that you don't have to use LCase when you use InStr to do a search. Just simply set the forth argument to vbTextCompare instead.
Code:
If Instr(1, MyString, "MYWORDTOSEEKFOR", vbTextCompare) <> 0 Then
Best regards
-
Sep 9th, 2000, 11:34 AM
#4
And Joacim's example works perfectly.
But I also wanted to point out that Inet will not always get the whole web page. It's best to use the Webbrowser itself to get the source:
Code:
Text1.Text = Webbrowser1.Document.documentElement.innerHTML
And then you can search for it.
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
|