Creating Variables in Word
Microsoft Word implements variables as DocProperty field codes. When you work with Microsoft Word source documents, typically you use variables defined in a Microsoft Word template by a Stationery designer. The variables in these templates will also include the built-in document properties such as Author or Subject. You import these variables into your Microsoft Word source documents when you apply the template to your source documents. After you import the variables, you insert the variables as appropriate.
Typically you should not need to create variables in your Microsoft Word source files if you use a Microsoft Word template created by a Stationery designer. However, in some cases you may need to create a variable in a Microsoft Word source document if you do not have a Microsoft Word template that includes a variable you need for your project.
The following procedure provides an example of how to create variables in Microsoft Word source documents using Microsoft Word 2007 and Word 2010.
Note: Newer versions of Word may or may not use this exact procedure, however this may provide enough information to get working with variables in Word.
To create a variable in Word 2007 or Word 2010
1. Go to File, and click Info
2. Click the Properties tab in the right-hand side of the window and click the Advanced Properties option from the dropdown
3. Click the Custom tab
4. Type in the Name of your variable in Name, for example BookName
5. For the Value, type in the information you want the variable to represent, for example User Guide
6. Click Add to add the variable to the list
Was this helpful?
Last modified date: 12/09/2021