hello, i have a function for highlighting keywords in text and it works fine if your typing keywords, but when i load a file it doesnt highlight the keywords i have that are in the file. in fact after loading a file, even if i type a keyword it doesn't highlight... any help?
heres the code i have to highlight:
vb Code:
Private Sub HighlightC(Find As String, Color As OLE_COLOR, MainColor As OLE_COLOR)
Dim i As Long
Dim txtBox As String
Dim intTxtLen As Integer
Dim intLength As Integer
Dim intStart As Integer
intLength = Len(Find)
txtBox = txtLoad.Text
intTxtLen = Len(txtLoad.Text)
With txtLoad
For i = 1 To intTxtLen
If Mid$(txtBox, i) = Find Then
.SelStart = i - 1
.SelLength = intLength
.SelColor = Color
.SelStart = intTxtLen
.SelColor = MainColor
End If
Next
End With
End Sub