Microsoft Word Question - Variable Fields

EKKC

Diamond Member
May 31, 2005
5,895
0
0
I'm building a user documentation for a client of mine, using MS Word 2007.

It's a technical documentation, but the contents it refer to may change from year to year. say the location of the file or objects, file names, object names, contact names, etc. etc.

I want to keep a table of variables in the word doc, and have the main doc refer to this list, so when I make a change to the variable (ex. CurrentYear goes from 2007 to 2008) that all references to the variable would follow as well.

Similar to a mail merge, but I won't be making many different copies, maybe a more glorified Search and Replace?
 

gsaldivar

Diamond Member
Apr 30, 2001
8,691
1
81
One way of doing it is to keep your variables in an Excel sheet or SQL database, and insert them into the Word 2007 document as data fields:

Insert > Quick Parts > Fields > Database Fields > Insert Data "as Field"

Once the data is in your Word document, you can make changes to the Excel file and have them populate to the Word document by right-clicking the fields and selecting "Update Field".

I'm not sure how you might trigger the Field Updates by changing your CurrentYear variable. Possibly some Visual Basic voodoo is needed here. Maybe someone who knows a bit more about that can add to this.

Good luck!
 
Sep 12, 2004
16,852
59
86
One way to ensure all the fields are updated to the latest data is to include a startup macro in the Word doc that has Ctrl+a, F9. Ctrl+a will select all in the document and F9 will updates all fields.