4 Understanding macro concepts
You can also use Microsoft® Visual Basic® for Applications (VBA) to create
macros for WordPerfect Office. For detailed information about VBA and VBA
macros, please see the Corel WordPerfect Office User Guide for VBA (vba_ug.pdf).
A macro consists of a set of instructions or statements. By using the various types of macro
statements, you can create PerfectScript macros that automate anything from a basic
task to a complex procedure. For more information about macro statements, see
“Understanding macro statements” on page 4.
Through the use of macro statements, PerfectScript lets you create macros that
access applications outside of WordPerfect Office. For more information, see
“Accessing external applications in macros” on page 77.
For even more information about macros, you can consult additional resources
for WordPerfect Office. For information, see “Learning more about macros” on
page 81.
The proper form of macro components is governed by a set of rules, or syntax. For more
information about macro syntax, see “Understanding macro syntax” on page 5.
If you structure your macros well, they will function well — and be much easier to edit.
For more information about macro structure, see “Understanding macro structure” on
page 5.
Understanding macro statements
If a macro represents a set of instructions, then a macro statement represents a single
step in those instructions. The simplest macro consists of only one statement, while the
most complex macro consists of multiple statements that are performed in sequence.
A group of related statements is called a “statement block.”
Some statements require an expression, which is a formula that represents a value. For
more information about expressions, see “Using expressions in macro statements” on
page 8.
By combining expressions with other macro components, you can create any of the
following types of statements:
• command statements — consist of a macro command, which represents a single
instruction (typically, an action). For more information, see “Using command
statements in macros” on page 47.