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:
  1. Private Sub HighlightC(Find As String, Color As OLE_COLOR, MainColor As OLE_COLOR)
  2.     Dim i As Long
  3.     Dim txtBox As String
  4.     Dim intTxtLen As Integer
  5.     Dim intLength As Integer
  6.     Dim intStart As Integer
  7.    
  8.     intLength = Len(Find)
  9.     txtBox = txtLoad.Text
  10.     intTxtLen = Len(txtLoad.Text)
  11.    
  12.     With txtLoad
  13.         For i = 1 To intTxtLen
  14.             If Mid$(txtBox, i) = Find Then
  15.                 .SelStart = i - 1
  16.                 .SelLength = intLength
  17.                 .SelColor = Color
  18.                 .SelStart = intTxtLen
  19.                 .SelColor = MainColor
  20.             End If
  21.         Next
  22.        
  23.     End With
  24. End Sub