R
Richard Berg
Hey,
I've got the following problem:
I have a Word document that I use as a template. In it I want to
replace any occurances of "[TEXT]" with the formated text that is
entered into a RichTextBox (I'm using c#). I load a Word.Document, get
a Range and a Find and then use Find.Execute to replace text. The
problem is that [TEXT] gets replaced with a string that represents the
entered RTF with rtf codes (like
"{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1053{\\fonttbl{\\f0\\fnil\\fcharset0
Times New Roman;}}\n\\viewkind4\\uc1\\pard\\b\\f0\\fs24
dasddas\\b0\\par\n\\par\nafasf\\par\nreerre\\par\n}\n\r\n\r\n{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1053{\\fonttbl{\\f0\\fnil\\fcharset0
Times New Roman;}}\n\\viewkind4\\uc1\\pard\\b\\f0\\fs24
dasddas\\b0\\par\n\\par\nafasf\\par\nreerre\\par\n}\n\r\n\r\n")
instead of the real text ("dasddas afasf reerre" in Times new roman
with first word in bold).
Is there any way to insert the text into the document with correct
formating?
Thanks!
I've got the following problem:
I have a Word document that I use as a template. In it I want to
replace any occurances of "[TEXT]" with the formated text that is
entered into a RichTextBox (I'm using c#). I load a Word.Document, get
a Range and a Find and then use Find.Execute to replace text. The
problem is that [TEXT] gets replaced with a string that represents the
entered RTF with rtf codes (like
"{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1053{\\fonttbl{\\f0\\fnil\\fcharset0
Times New Roman;}}\n\\viewkind4\\uc1\\pard\\b\\f0\\fs24
dasddas\\b0\\par\n\\par\nafasf\\par\nreerre\\par\n}\n\r\n\r\n{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1053{\\fonttbl{\\f0\\fnil\\fcharset0
Times New Roman;}}\n\\viewkind4\\uc1\\pard\\b\\f0\\fs24
dasddas\\b0\\par\n\\par\nafasf\\par\nreerre\\par\n}\n\r\n\r\n")
instead of the real text ("dasddas afasf reerre" in Times new roman
with first word in bold).
Is there any way to insert the text into the document with correct
formating?
Thanks!