Claudio,
Your code will miss the first occurence if it's located at the very beginning of the control because the character position in RTF control is 0-based. It should be
lnpos = 0
...
Do while lnpos >= 0
...
>
>He is trying to highlight for every occurrence of some text.. Starting by sergey's answer.. Here we go:
>
>Works perfectly here..
>
<snip>
--sb--