Hello bkspace,
You will need to parse the text in the richtextbox for the words you want to change the color for.
Once you find a word you then would use the the selstart, sellen and selcolor proporties to change the color of the word.
As such:
Code:
Private Sub Command1_Click()
Dim I As Long, lRtn As Long
Dim sSrchText As String
sSrchText = "Word" ' text to look for
For I = 1 To Len(rtb1.Text) ' set up a loop to search the text
lRtn = InStr(I, rtb1.Text, sSrchText, vbTextCompare) 'search for the text
If lRtn > 0 Then ' if you found something change the color
rtb1.SelStart = lRtn - 1
rtb1.SelLength = Len(sSrchText)
rtb1.SelColor = QBColor(2)
I = lRtn ' normally you would not do this but it does speed things up
Else
Exit For ' if you don't find anymore exit the loop
End If
Next I
End Sub
Hope this helps a little,
Roger
[Edited by RvA on 04-16-2000 at 04:26 PM]