Quantcast
Channel: Word for Developers forum
Viewing all articles
Browse latest Browse all 4350

A string is split into multiple w:t elements by Word

$
0
0

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.


Viewing all articles
Browse latest Browse all 4350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>