Writer Guide
Choose or define a variable
You can use the following variables in your condition:
• User-defined variables
• Predefined OpenOffice.org variables, which use statistical values
from the document properties
• User data
• Database field contents—for example from your address book
You cannot use internal variables (for example, page number or
chapter name) to formulate conditions.
The examples in this chapter use user-defined variables.
Define a logical expression (condition) involving the
selected variable
The condition compares a specified fixed value with the contents of a
variable or database field.
To formulate a condition, use the same elements as you would to create
a formula: operators, mathematical and statistical functions, number
formats, variables, and constants. The possible operators are given in
the online help; look in the index under “operators: in formulas”. You
can define quite complex expressions, but in most cases a simple
condition will do the job.
Create the variable
To create your variable, click Insert > Fields > Other. You can use
choices found on the
DocInformation
,
Variables
, and
Database
pages.
DocInformation fields
“Using document properties to hold information that changes” on page
439 described how to set up a user-defined document property. You
can use that document property as the variable in your condition
statement, or you can create another document property field
specifically for conditions.
User-defined variable field
To set up a variable or user field:
1) Place the cursor where you want the field to be inserted.
2) On the Fields dialog box, select the
Variables
page (Figure 393).
Chapter 14 Working with Fields 455