I am dynamically generating a word document and need to replace my special tags using a html content which is generated using CKeditor control. Here the word document i am using is a template which contains pre entered texts and for generating document i am using Microsoft.Office.Interop.Word. Now i can find my special tag using interop's doc.range.Find methord. But when i want to replace this tag with a HTML content without losing its style. how can i do this?
using doc.range.Find.replacement.text is not practical because it will just replace the whole tag with html text.
Example: In my word document i have a special tag like shown below
##<Special Conditions Frag>##
during document generation i need to accept some text from user which is entered via ckeditor control(It will be in HTML format with body tag and all). And this html content i need to replace with above special conditions frag tag in word document.
My HTML content looks like below
<html>
<head>
<title></title></head>
<body>
<p>
<strong>Sample text</strong>
</p>
</body>
</html>