Please see the attached Word 2010 document with a simple text box in it. When you select that Text Box, the Tab on top offers properties for “Drawing Tools”. Also, when I try to change Color Themes under Page Layout, the text font and box background color changes - as it’s appropriate for the theme.
Now, I run the following code snippet using this document, in which I create a new document by cloning the current one. After the document is saved, the Text Box in the new generated document does not appear with “Drawing Tools” tab, but with a “Text Box Tool” tab. Also, changing the Color Theme for it does not change the text box background color.
Document source = new Document(“c:/sourceFileTextBox.docx”);
Document doc = source.deepClone();
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions( SaveFormat.DOCX );
saveOptions.setCompliance( OoxmlCompliance.ISO_29500_2008_TRANSITIONAL );
Please let me know if there is a way to save the new document so that the text box properties are kept unchanged and Color Theme change works OK in the new generated document.