One of the most frustrating things for Word power users and developers is the accumulation of “bugs” in the product. If a problem is not caught early in the beta stage, it’s often around to stay. When pressed, the product team will often say that changing “expected behavior” will break backwards compatibility. Another reason we hear is that available resources are being used to “improve the product” (add new things). So when someone discovers a bug has actually been fixed, it’s a reason to ring the bells!
A few days ago a colleague asked me to check whether there really is no work-around for a problem that cropped up when Word moved from the binary *.doc to the Open XML *.docx file format in Word 2007. When a file containing form fields is saved as a template in Word 2007 and in Word 2010 any Number Formatting applied to a textbox form field is lost.
Before confirming the issue, I decided to test it in Word 2013, even though I was pessimistic, given Microsoft’s track record. But lo and behold: The problem has been fixed! Templates saved in Word 2013 retain the number formatting. What’s more, when used in Word 2007 and Word 2010, the templates function as they should.
So not only is a bug fixed, but at the same time a work-around for the problem in Word 2007 and Word 2010 is now available.
The problem can be seen and even corrected in the Word Open XML file. Locate a form field by searching in document.xml for the element
<w:textInput> (denotes a textbox form field). Below that look for the child element
<w:type w:val="number" />. If there is no child element
<w:format w:val="[number format here]" /> then you’ve found a potential problem spot. Here’s a sample of correct Open XML for a form field with a number format:
<w:type w:val=”number” />
<w:format w:val=”#’##0.00″ />