Variables allow you to write content once, and manage it in one place for reuse across your project — or projects. If you create variables for content that you use frequently, you can:
- Insert that content into your project quickly (no cutting/pasting)
- Edit that same content in a single location, and automatically update your entire project (no searching and updating each instance manually)
- Import Variables from other projects (managing content efficiently)
Doc-To-Help lets you create two types of variables, Text and Rich Content. In this post, we’ll take a closer look at Text Variables.
Text Variables may be used for any amount of unformatted text. This means that when you insert a Text Variable within your project, it will take on the formatting around it. Text Variables can be assigned conditions, which makes them extremely flexible.
Common Examples of Text Variables include:
- Product name
- Company name
- Frequently used descriptions
- Addresses
- Copyright notices
Let’s discuss how to create a text variable, how to insert a text variable, and how to import variables from other projects. (This example uses Word source documents, but the process is very similar in the built-in editor.)
How to create a Text Variable
- In Doc-To-Help, open the Variables window. (Project tab > Variables button)

- In the Text Variables area, click on the Add New Variable toolbar button. An editable field named <New Variable> will appear in the Name column.

- Enter a name for the variable, then double-click <Variable text> in the Text column to enter the text (one word or more). If you’d like, double-click in the Condition column to choose a Platform, Target, or Attribute condition for the variable.

- Platforms — The variable will be included in all of the target platform(s) selected. A platform includes all the targets that produce the output specified; Online Help, HTML Help, NetHelp, Printed Manual, etc.
- Targets — The variable will be included in all the target(s) selected.
- Attributes — The variable will be included or excluded when creating conditional builds (for example, internal or external.) Use the Attributes dialog box (Project tab > Project ribbon group > Attributes button) to create custom attributes.
If you would like to assign more than one condition to this variable, select its name and click the Add Text with Condition toolbar button. An additional <variable text> field will open. Enter the appropriate text, then double-click in the Condition column to choose a condition. One Text Variable can have multiple unique outputs.
How to insert a variable:
- Select the appropriate text in the document. (You may want to use the name of the Variable. The text selected will be completely replaced by the variable — see the example below.)

- Click the Variable button. The Variable dialog box will open. The selected text will be displayed in the Text area.
- Choose the appropriate Variable from the list.
- Click OK.
- Build the project.
The Target will include the variable everywhere it was inserted.
When something changes (like the product name) — just update the Text Variable and rebuild.
How to Import Variables:
Many things can be imported from other projects; let’s talk about variables specifically.
- In Doc-To-Help, choose File > Tools > Import Project Settings. A Wizard will open and let you choose to import settings from any Doc-To-Help project.

- Choose the project, and when you get to the appropriate screen, choose the Variables check box.

- Click Import. The Variables in the selected project will be imported into the current one and are ready to be inserted.
Simple!
Next time we’ll take on Rich Content Variables.






Is it possible to search/replace a Word document and replace a specific word with a variable ?
Very good, clean and clear instructions, this is something I can use. Thank you.
Very nice and useful. I’ll keep in touch wainting for other articles.
Thanks!
Great article, Nicky! I’m looking forward to the Rich Content Variable article next! Thanks!