Here's an algorithm:

Function GetRedString(rtf as RichTextBox) As String

dim i as long,ret as string
rtf.sellength = 1

for i = 1 to len(rtf.text)
rtf.selstart = i
if rtf.selcolor = vbRed then ret = ret & rtf.seltext
next i
GetRedString = ret
End Function

I just wrote that off the top of my head, so im not 100% sure it works, give it a whirl. Basically it checks the RGB value of each character in the textbox against the selected color, if they match it adds the character to a string, and returns it.


------------------
-Mystiq