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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
SLECommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
2GreyAuthor Commented:
Thanks, it works great.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.