Purpose : take docx put text from some outer datasorce to content controls (dictionary CCtag, value to keep it simple). And remove CC from document keeping all text and formating.
Spent 3 day already. The only result I achieved - I can find and delete content controls from docx. But any try to add text lead to document corruption. Tried to insert
<w:t>bla-bla</w:t>
Probably cause of error is these attributes
w:rsidR="006D4366" w:rsidRPr="00E71775" w:rsidRDefault="006D4366"
w:rsidP="006D4366" which are usually present in tags. Have no idea how to generate them.
Besides the aproach with replacing CC with text is not the best one. In this case all formatting is lost. Will be very thankful for any help.