I have to generate a Word document with lots of values from a database. I use a template docx file created using Word and then have replaceble fields using words beginning with %, for example, %name, %dob, etc etc.
Half of the fields are ok. But half, eg %mstatus get split up like this in the docx and hence fail the string Replace method:
<w:t>%</w:t>
<w:t>mstatus</w:t>
The above happens even if I type the whole string continuously without pause.
What is the cause of this "random" corruption? Is there a way to prevent this?
If instead of '%' I use another character (that won't interfere with real text) for example '#' will the same thing happen?
Thanks.