Open topic with navigation
You can run an action conditionally based on a variable or expression. For example, actions run when you open Print Preview for a . However, you might not want the actions to run in Print Preview. In this case, you can use the IsPrintPreview
or IsPrinting
global variable to prevent an action from running when the document is not actually sent to the printer.
To run an action conditionally, configure the condition on the Action tab for the action, as follows.
To run an action conditionally based on a variable
Use this option when only one condition determines whether the action runs.
-
On the Action tab for the selected action, click to select Conditionally, based on variable.
-
In the variable name field, click , and then click More Variables to open the Insert Variable dialog.
-
In the left navigation pane, click the category of the variable that you want.
-
In the variable list, select the variable that you want, and then click OK. Alternatively, double-click the variable.
-
On the Action tab, click the relational operator to display a list of additional operators, and then click the one that you want to use. For more information, refer to Relational Operators.
-
When the relational operator requires a value to be specified, the <enter a value> field is displayed. Click this field, and then enter the value that you want.
-
In the type list, select Text or Decimal to specify whether the conditional statement is evaluating a text or decimal value.
For example, when you want to use the IsPrintPreview
variable to specify that an action is not run when you open the document in Print Preview, follow these steps:
-
On the Action tab for the selected action, click to select Conditionally, based on variable.
-
In the variable name field, click , and then click More Variables to open the Insert Variable dialog.
-
In the left navigation pane, click Global.
-
In the variable list, select IsPrintPreview, and then click OK. Alternatively, double-click the variable.
-
On the Action tab, click the relational operator, and then click Equals.
-
In the <enter a value> field, enter false.
-
In the type list, select Text.
To run an action conditionally based on an expression
Use this option when more than one condition determines whether the action runs.
-
On the Action tab for the selected action, click to select Conditionally, based on expression.
-
To change the existing conditional joiner (by default, this is And), click the joiner in the Tree View tab, and then click the joiner that you want.
-
To add a conditional joiner, click .
-
In the variable name field, click , and then click More Variables to open the Insert Variable dialog.
-
In the left navigation pane, click the category of the variable that you want.
-
In the variable list, select the variable that you want, and then click OK. Alternatively, double-click the variable.
-
On the Action tab, click the relational operator to display a list of additional operators, and then click the one that you want to use. For more information, refer to Relational Operators.
-
When the relational operator requires a value to be specified, the <enter a value> field is displayed. Click this field, and then enter the value that you want.
-
In the type list, select Text or Decimal to specify whether the conditional statement is evaluating a text or decimal value.
Related Topics