Private Sub btnColor_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
'select a hilite color
CD1.ShowColor
btnColor.BackColor = CD1.color
End Sub
Private Sub btnFind_Click()
Call find_and_hilite(txtFind)
End Sub
Private Sub Form_Load()
Show
WB1.Navigate Text1
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set oBody = Nothing
Set oDoc = Nothing
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
'if enter key, kill the boooop sound and navigate
If KeyAscii = vbKeyReturn Then
KeyAscii = 0
WB1.Navigate Text1
End If
End Sub
Private Sub WB1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
btnFind.Enabled = False
btnColor.Enabled = False
End Sub
Private Sub WB1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
'set ref to the browsers document
Set oDoc = WB1.Document
DoEvents
'set ref to the documents body
Set oBody = oDoc.body
btnFind.Enabled = True
btnColor.Enabled = True
End Sub
Private Sub find_and_hilite(str_to_find As String)
Dim oRange As MSHTML.IHTMLTxtRange
Dim bfound As Boolean
'start the range to encompass ALL the pages text
Set oRange = oBody.createTextRange
Do 'tell the orange object to find the text (str_to_find (txtFind))