Hi
Here is some code that may be helpful. This is a stand alone example and you need to try it before using it. To try it, start a new test Project, on Form1 put a RichTextBox named RTB, a default ComboBox1, Button1 and a ContextMenuStrip with "RED, LIGHT BLUE, GREEN and WHITE" items on it.
The idea here is: user selects a word and a colour from the ComboBox then clicks the 'CUT" button. With luck, all words matching selected word and matching selected colour will disappear.
There are lots of variations possible, this being one of them.
There is also a ContextMenu to enable a colour selection (just a simple choice) for testing purposes. Just select a word or some text and then right click for the colour choices. (colour options would normally be much more comprehensive in a real world application)

Option Strict On
Option Explicit On
Public Class Form1
Dim path As String = IO.Path.Combine(Application.StartupPath, "RTB.rtf")
Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
' if you want to save on close - uncomment
RTB.SaveFile(path, RichTextBoxStreamType.RichText)
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
With RTB
' to load previously saved text - uncomment
'If IO.File.Exists(path) Then
' .LoadFile(path)
'End If
.ContextMenuStrip = ContextMenuStrip1
.ShowSelectionMargin = True
.ZoomFactor = 2.5
' some sample text for testing with
.Text = "This Is some example text To illustrate the slow unreliable way To Select And delete all words which have a given text colour.
There may well be other ways To Do this which may also be far better than this way, but I have never noticed them in the past."
End With
With ComboBox1
.Items.AddRange({"RED", "LIGHT BLUE", "GREEN", "WHITE"})
.SelectedIndex = 0
End With
End Sub
Private Sub ContextMenu_Click(sender As Object, e As EventArgs) Handles REDToolStripMenuItem.Click, LIGHTBLUEToolStripMenuItem.Click, GREENToolStripMenuItem.Click, WHITEToolStripMenuItem.Click
Dim cm As ToolStripMenuItem = DirectCast(sender, ToolStripMenuItem)
Select Case cm.Text
Case "RED"
RTB.SelectionColor = Color.Red
Case "LIGHT BLUE"
RTB.SelectionColor = Color.LightBlue
Case "GREEN"
RTB.SelectionColor = Color.Green
Case "WHITE"
RTB.SelectionColor = Color.White
End Select
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim s As String = ComboBox1.SelectedItem.ToString
Select Case ComboBox1.SelectedItem.ToString
Case "RED"
CutWords(Trim(RTB.SelectedText), Color.Red)
Case "LIGHT BLUE"
Case "GREEN"
Case "WHITE"
End Select
End Sub
Sub CutWords(s As String, c As Color)
Dim words() As String = RTB.Text.Split(New String() {" ", ".", ",", vbLf, vbCr}, StringSplitOptions.RemoveEmptyEntries)
Dim inx As Integer = 0
For Each w As String In words
If w = s Then
inx = RTB.Text.IndexOf(w, inx + 1)
RTB.Select(inx, w.Length)
If RTB.SelectionColor = c Then
RTB.Cut()
End If
End If
Next
End Sub
End Class