Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm creating technical documentation that lists steps for a software upgrade process. Versions, database server names, etc. change for every upgrade, but the steps remain the same.

I'm looking for a way to maintain a table at the top of the document, which will fill in placeholder values in the upgrade steps. The template would look something like:

  1. Connect to <ServerName>.
  2. Change database context to <DatabaseName>.

The output should be:

|Key          | Value        |
|ServerName   | TestServer   |
|DatabaseName | TestDatabase |
  1. Connect to TestServer.
  2. Change database context to TestDatabase.

What is the best way to approach something like this in Word? My attempts so far have been to create placeholders, and I've populated a general table for the keys/values, but I'm not sure how to connect the two.

share|improve this question
+1 Interesting question! Is VBA a valid option? Or should it be solved using fields? – nixda Jul 31 '13 at 21:47
+1 also. Fields would be my choice. Even the database field could be utilized – Raystafarian Jul 31 '13 at 23:11
up vote 1 down vote accepted

Use Word's fields function, particularly the SET and REF function.

With { SET myname "myvalue"} you initially create an association. From now on you can reference to this field as often as you want from everywhere in the Word document. You can edit the value and update all references by selecting all fields » right-click » Update field (or) CTRL+A and F9.

It works the same way as Excel cell references.

With {REF myname } you recall the value of myname as often as you want. Also, you can copy the whole REF field and change myname to another valid field name to reference to that field instead. This way, you don't have to open all dialogs again.

Apropos dialogs, you have to insert at least one SET and REF field through the long way. Later, you just copy and edit all fields without any dialog. To do this go to Insert » Explore quick parts » Insert field. Scroll down to SET or REF and on the bottom left you click on "Field codes". Here you insert the corresponding syntax I already mentioned.

This may differ on older Office versions but the principle stays the same.

enter image description here

If everything is prepared it should look similar to this:

enter image description here
Field codes are shown

enter image description here
Field codes are hidden

From now on, you open your Word template, change some SET values and refresh all fields.
Use Right-click »Toggle field codes to edit single fields or hit ALT+F9 to show/hide all fields at once.

Tip: You can choose if a field should use the source formatting or the target area formatting through right-clicking a field » Edit field » check Preserve formatting during updates

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .