Web Browser control - Find dialog

Hello, I am trying to create a find dialog to look through a web browser control. I am not sure of how to do this as there is no text property for a web browser control that can be read in and searched through. I am also curious on how a find dialog can highlight the found word ans there are no sel properties for the text that is being displayed in the browser control.
2GreyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
SLEConnect With a Mentor Commented:
The following code adds a "find next" button the the above implementation:

Private Sub cmdFindNext_Click()
    Call oRange.Move("word")
    If oRange.findText(sSearch) Then
        oRange.Select
    Else
        MsgBox "Not found anymore!"
    End If
End Sub


I don't think the web browser control provides functionality to find multiple entries at the same time though...
0
 
SLECommented:
Assuming you've got a web browser control wbbTest and a command button cmdFind, the following code implements a casual "find" which highlites the word(s) the user is looking for on a page in the web browser control:

Dim oRange As Object
Dim sSearch As String

Private Sub cmdFind_Click()
   Set oRange = wbbTest.Document.Body.createTextRange
   sSearch = InputBox("Enter search string:")
   If oRange.findText(sSearch) Then
      oRange.Select
   Else
      MsgBox "Search string not found."
   End If
End Sub



SLE
0
 
2GreyAuthor Commented:
this search method does work but not for finding multiple entries. Any additional information on this would be appreciated
0
 
2GreyAuthor Commented:
Thanks, it works great.
0
All Courses

From novice to tech pro — start learning today.