Subversion's "keyword" feature is great to automatically tag text files with the revision number. I'd really like to do a similar thing for Word and/or OpenOffice documents.
I tried this with Word documents, by inserting a "fixed-width" keyword substitution into the "comment" document properties field. But it seemed to still corrupt the document somehow (plus I don't know what "fixed-width" might mean in the case of multi-byte characters). I also didn't like this idea because it would not be good for inserting the number in the printable part of the document itself.
What I'm imagining now is a macro that automatically runs on document open, and updates a custom document property. The document could contain doc property reference fields that get updated with the value stored in the doc property.
Has anyone done this, or done anything else to achieve this goal? For either Word or OpenOffice?