ok...con questo più o meno funziona....
ma ha qualche problema....qualcuno potrebbe provarlo e "aggiustarmelo"...perchè quando scrivo i delimitatori che ho scelto mi fa casino...e poi il cursore mi va sempre alla fine del foglio...cioè all'ultimo carattere..
codice:
Private Sub ColorTags(txtEdit As RichTextBox)
Dim txt As String
Dim tag_open As Integer
Dim tag_close As Integer
txt = txtEdit.Text
tag_close = 1
Do
' See where the next tag starts.
tag_open = InStr(tag_close, txt, "(")
If tag_open = 0 Then Exit Do
' See where the tag ends.
tag_close = InStr(tag_open, txt, ")")
If tag_open = 0 Then tag_close = Len(txt)
' Color the tag.
txtEdit.SelStart = tag_open - 1
txtEdit.SelLength = tag_close - tag_open + 1
txtEdit.SelColor = vbRed
Loop
End Sub
grazie!