Link to home
Start Free TrialLog in
Avatar of 2Grey
2Grey

asked on

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.
Avatar of SLE
SLE

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
Avatar of 2Grey

ASKER

this search method does work but not for finding multiple entries. Any additional information on this would be appreciated
ASKER CERTIFIED SOLUTION
Avatar of SLE
SLE

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 2Grey

ASKER

Thanks, it works great.