Please help, I am batlling for 2 days now with this problem:

I want to replace a text string, say "*" with "#" in a selected text portion in a RichTextBox.
When I use this code:
X = Replace(RichTextBox1.SelRTF, "*", "#")
RichTextBox1.SelRTF = X
it works fine, but when the selected text contains any maths equation object, it does not work properly. (There is always "###" in front of the equation)