Document templates
What a Word template actually remembers
Open a Dynamics document template in Word and you see a document. The content
controls look like ordinary grey placeholder text, and three of them can read
description while pointing at three different columns on three different
tables. What decides which is which is an XPath expression bound to a custom XML
part inside the file, and Word will not show it to you without clicking each
control in turn.
That is why a template quietly breaks after somebody renames a column, and why it is so hard to say from the outside which templates a schema change is about to hit. The usual answer — open each one and click through every control — does not scale past about three templates, and it is exactly the kind of check that gets skipped in the week a release is due.
A .docx is a zip archive. The bindings are already in there, in a part the
Word UI declines to show you, and reading them is a file operation rather than
an interactive one. Once they are a list, “which templates touch this column” is
a question with an answer.
We wrote Document Template XRay to get that list.