I would say it is better to have the styles.xml bloat than it is to have document.xml bloat. Using local formatting to change globally to Calibri would result in document.xml being unduly cluttered whereas a style change (conceptually) should be more more discrete.
I don't see why running Paul's code would cause the default style settings to suddenly appear in the Styles.xml file but I am surprised they weren't there in the first place. I assume that the document had never modified any style definitions and therefore it was using the built-in style definitions to build this information on the fly. Did you create your docx file from the GUI or are you using code to create the document? It is unusual for people posting on this forum to go digging in the xml components so I assume you are using advanced processing methods that may not be typical Word users methods.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
|