H
Harry
I use the following Code to find a special text in webbrowser document, not
by displaying a IE find dialog box.
but if HTML support Frame then I get the error (run-time error "438"). any
idea
how to fix this error.
Thanks,
Harry
by displaying a IE find dialog box.
but if HTML support Frame then I get the error (run-time error "438"). any
idea
how to fix this error.
Thanks,
Harry
Code:
Public myfindFirst As Boolean
Public oRange
Private Sub cmdFind_Click()
Dim sSearch As String
If myfindFirst Then
Set oRange = WebBrowser1.Document.body.createTextRange
sSearch = txtFind.Text
If oRange.FindText(sSearch) Then
oRange.Select
oRange.scrollIntoView
cmdFind.Caption = "Find Next"
myfindFirst = False
Else
MsgBox ("Search string " & txtFind.Text & " not found.")
End If
Else
Call oRange.Move("character")
sSearch = txtFind.Text
If oRange.FindText(sSearch) Then
oRange.Select
oRange.scrollIntoView
Else
MsgBox ("Finished searching Document for string " &
txtFind.Text)
cmdFind.Caption = "Find"
myfindFirst = True
Exit Sub
End If
End If
End Sub