Wednesday, March 27, 2019

How to Use Variables in Word Documents

You can easily create variables to use in your Word documents. These variables can be for anything you want, but they’re especially useful for things that might change, such as a product name. For example, I once worked on a project where our marketing department changed the name of the product a week before the scheduled release. Fortunately, I insisted at the beginning that our writers use variables and making the change was trivial.

To create a document variable:

  1. Click File. The Info pane appears.
  2. Click Properties > Advanced Properties. The [Document Name] Properties dialog appears.
  3. Select the Custom tab.
  4. In the Name field, type a name for your variable; for example, Product.
  5. In the Value field, type the value you want your variable to have, for example, SecretFileSaver.
  6. Click OK.

To insert the variable in your document:

  1. Choose Insert > Quick Parts > Field. The Field dialog appears.
  2. From the Categories list, select Document Information.
  3. From the Field Names list, select DocProperty.
  4. From the Property list, select the name of your variable.
  5. Click OK.

This may seem like an awful lot of work, but there is an easier way. Now that you have the variable in your document, you can assign it to an AutoText entry, so that you don’t have to go through the whole process every time you want to use it.

To create an AutoText entry for the variable:

  1. In your document, select the variable.
  2. Choose Insert > Quick Parts > AutoCorrect. The AutoCorrect gallery appears.
  3. Click Save Selection to AutoText Gallery. The Create New Building Block dialog box appears.
  4. In the Name field, type a short name for your variable, for example, sfs.
  5. Click OK.

To insert the variable into your document using AutoText, type the short name and press F3.

To change your variable, follow the same steps you did to create it, but modify the name.

To update the document with the new name, choose Print Preview or Edit > Select > All and press F9.

No comments: