Hi Jang,
I noticed that what makes the script crash is the line "oDoc.TextSelection = oTRange;". When I replace oDoc.TextSelection with oRange, the script stops crashing. However, it does not delete the original text - the replacing text is added to the original one. How can I delete the original text? You set oDoc.Clear () to 0, so it's not clear what it is used for in this code.
Please, advise.
Thank you in advance!