I am creating an application that targets at converting existing xml documents of Word 2003 to DOCX by replacing Custom XML elements with Content Controls. I am using Interop assemblies + Word 2007 for this purpose as only Word 2007 can support Custom XML elements and Content Controls.
The approach proposed is as below: 1. Read the xml document 2. Save as DOCX. 3. Identify XMLNodes (Custom XML elements) from the DOCX file 4. Place new Content Controls in the range of XMLNodes /Mapping XMLNodes to Content Controls. 5. Remove XMLNodes.
I am finding issues when implementing the above. Issue is that in Step 4 mentioned above, all content controls added to the document are removed once the document is saved. This is because the document is saved in Word 2003 compatibility mode and Word 2003 doesn’t support Content Controls.
I have tried a lot to disable the compatibility mode but couldn’t achieve it.
Can anyone of you kindly suggest me some methods of doing it?