Only Plain text ...error

Hi,

I am trying to customize mail template as per the user requirements. I’ve written a code in CoreEmailClasses script library of the Mail Template. As I need to get handle of the Rich Text Field I’ve written “uidoc.Refresh (true)” in the code. Every time the Send button is clicked in the Memo this code gets executed and stops with an error “only plain text isallowed in this type of field error”, at the line “uidoc.Refresh (true)”. I need to get rid of this error and still keep the line "uidoc.Refresh (true). Can somebody help me with gettting rid of this error.

Thanks much in advance for your help.