How do I Search a word within a richtextbox?(like a spell checker)
Printable View
How do I Search a word within a richtextbox?(like a spell checker)
You could use the Instr function.
Or you can use it's Find function.Code:Private Sub Command1_Click()
If InStr(RichTextBox1, "Text") Then
MsgBox "string found"
Else
MsgBox "string not found"
End If
End Sub
Code:Private Sub Command1_Click()
RichTextBox1.Find "Text"
RichTextBox1.SetFocus
End Sub
thanx ill try that