WordPerfect X3 Manual
WordPerfect X3 Manual
WordPerfect X3 Manual
Table of contents
WordPerfect
Getting started in WordPerfect. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
Discovering WordPerfect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Exploring the work area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating and opening documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Entering and inserting text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Selecting and deleting text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Performing Web searches powered by Yahoo! . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
2
3
4
6
7
19
20
21
24
25
Indenting text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Justifying text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Changing the spacing between lines and paragraphs . . . . . . . . . . . . . . . . . . . . . 38
Table of contents
iii
Numbering pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Changing the appearance of page numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69
Setting up a printer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Setting up a print job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Previewing a print job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Printing documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Controlling a print job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Printing double-sided pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Printing document sections and comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Printing file details. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Printing envelopes and labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Printing graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Laying out a print job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
iv
Table of contents
88
90
91
92
93
Using QuickMacros. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Recording, saving, and storing macros. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Playing macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using macros included with WordPerfect . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using toolbars for macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using template macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing and deleting template macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Triggering macros from templates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Customizing WordPerfect macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Assigning template macros to keystrokes, menus, and toolbars . . . . . . . . . . . .
Table of contents
192
193
195
196
198
200
202
203
206
209
v
vi
Table of contents
Discovering WordPerfect
WordPerfect X3 provides exceptional ease of use and complete formatting control for
producing newsletters, articles, reports, proposals, books, and other documents. The
popular Reveal Codes, Corel RealTime Preview, and Legal features help reduce the
amount of time you spend on document formatting, freeing you to focus on creating
content. WordPerfect X3 also provides enhanced compatibility with Microsoft Word,
the new ability to import PDFs, and robust PDF publishing capabilities that ensure you
can freely exchange information with colleagues and clients, regardless of the software
they use.
Heres a list of some of the new and enhanced features:
New! Import PDF files with WordPerfect
For more information, see Working with PDF files in the online Help.
Enhanced! Publish to PDF
For more information, see Working with PDF files in the online Help.
New & Enhanced! Word Count
For more information, see Counting words in the online Help.
Getting started in WordPerfect
The property bar is a context-sensitive toolbar that displays buttons and options related
to the task you are performing. For example, when text is selected, the property bar
contains only text-related commands.
You can also apply the default template to a new document by clicking the
New blank document button on the toolbar.
To open a document
1 Click File ` Open.
2 Choose the drive and folder where the document is stored.
3 Choose a file.
4 Click Open.
You can also open a document by clicking the Open
If you know where a file is located, you can type the full path and filename in
the File name list box.
A check mark next to the menu command indicates that the shadow cursor is
enabled.
2 Click anywhere on the page.
3 Type text.
The shadow cursor changes appearance to show how text will be aligned when
you start typing. Small arrows beside the shadow cursor point in different
directions when text is left-justified, centered, or right-justified.
The text you select is removed from the document. You can copy the text by
holding down Ctrl while dragging.
To select text
To select
Do the following
A character or word
A sentence
A paragraph
A page
A document
To deselect text
Click anywhere outside the selected text.
To delete text
1 Select the text you want to delete.
2 Press Delete.
You can also delete text by clicking after the text you want to delete and
pressing Backspace.
The new Yahoo! Search bar lets you quickly search the Web and access important online
resources.
Counting words
With WordPerfect, you can find out how many words are in a document or in selected
text. You can also verify the number of pages, paragraphs, sentences, and lines that are
in the document. In addition, you have the ability to exclude various elements, such as
headers, footers, footnotes, endnotes, or comments, from the word count.
The new <Count> button appears on the Application bar, making it easier than ever
to count words in a document.
11
If you want to convert the files in the folders within the folder, enable the Include
subfolders check box.
5 From the Convert to list box, choose a version of WordPerfect.
Saving documents
By default, you can save documents in WordPerfect 6/7/8/9/10/11/12/X3 format. This
ensures cross-platform compatibility for documents saved in WordPerfect 6.x and later,
and lets you save a document in an earlier version of WordPerfect. You can also save
documents in formats other than WordPerfect, such as Microsoft Word.
WordPerfect lets you save documents in compound file format. When you save a
document in compound file format, OLE compound document information is wrapped
around the WordPerfect document, which lets you open the document more quickly.
However, saving a document containing embedded objects in compound file format
increases both the file size and the time required to open and save the file.
You can save selected text or graphics in a new WordPerfect document.
WordPerfect lets you create backup copies of documents. Creating backup copies helps
prevent the loss of your work if you close a document before saving it, or if a power
failure occurs.
To save a document
1 Click File ` Save.
2 Choose the drive and folder in which you want to save the file.
To save a file in a format other than WordPerfect, choose a file format from the File
type list box.
3 Type a name in the Filename box.
To embed the fonts in the document, enable the Embed fonts using TrueDoc
check box.
4 Click Save.
You can also
Save changes to a document
12
If you have already saved the document, you will not be prompted to specify
the drive, folder, and filename.
Embedding ensures that the information for all fonts used in a document is
saved with the document. You may want to embed fonts if you are using an
unusual font, or if you want to ensure that the font you are using is displayed
properly.
A filename cannot exceed 255 characters.
You can also save a document by pressing F3 or by clicking the Save
on the toolbar.
button
13
Selected graphic
4 Click OK.
5 In the Save file dialog box, choose the drive and folder in which you want to save
the file.
6 Type a name in the Filename box.
7 Click Save.
14
15
Page to display the document the way it will look when printed
Two pages to display two consecutive pages in a document side by side
Preview in browser to display a document in HTML format
You can also
Switch between Preview in browser and
Page view
button.
You can hide or display formatting codes. You can also customize the display of the
codes; for example, you can specify the font style and color, and several other formatting
options. In addition, you can print the contents of the Reveal Codes window.
For more information about printing Reveal Codes, see
16
17
Formatting pages
WordPerfect lets you format a document by modifying the physical arrangement of
information on pages. For example, you can adjust page size and margins. You can also
add columns to documents. When formatting pages, you can modify the format of an
entire page or a portion of a page.
In this section, youll learn about
setting page margins
choosing page size and orientation
customizing page sizes
making text fit a specific number of pages
creating and deleting columns
19
20
Page sizes are matched to the printer you have selected. A size may not be available
when you change to another printer or a different computer. If the same size is not
available, WordPerfect finds the best match for a page size, selecting from those
available with the other printer. If the match does not work, you may need to customize
a page size.
21
Therefore, you can apply the custom size to more than one document. If you no longer
require the custom or modified page sizes, you can delete the page size or restore the
default page sizes.
In addition, you can divide a physical page into several logical pages. Dividing pages is
useful when you want to create small documents, such as pamphlets, raffle tickets, or
business cards.
As you edit a document, each logical page is treated as a separate page. The document
window also changes to show the dimensions of the logical page. After you fill a logical
page, the text continues on the next logical page.
22
The paper source is not saved as part of the document. It must be redefined for
each document.
All printers have a nonprintable zone. If information is formatted to print in
this area, it will not print. To shift information out of the nonprintable zone,
you must specify printing adjustments.
23
5 Click Delete.
When you delete a page size definition, you can no longer use that definition;
a document can print with a similar page definition, but it may not be an exact
match.
To divide a page
1 Click File ` Page setup.
2 Click the Layout tab.
3 In the Divide pages area, type a value in one of the following boxes:
Columns lets you divide a page into a specified number of columns
Rows lets you divide a page into a specified number of rows
Right margin
Top margin
Bottom margin
Font size
Line spacing
5 Click Make it fit.
To make only a certain block of text fit, select the text.
These are examples of pages with columns. The left page displays newspaper columns.
The right page displays balanced newspaper columns.
The parallel column text is grouped across the page in a row. The next row starts below
the longest column of the previous row. Parallel columns are useful for resumes, scripts,
charts, inventory lists, or lists where columns span multiple pages.
Formatting pages
25
Parallel columns with block protect keep each row of columns together. If a column in
one row becomes so long that it moves across a page break, the entire row moves to the
next page. You can also use tables to create this type of column. For information about
working with tables, see Using tables and charts in the online Help.
To create columns
1 Click a page.
2 Click Format ` Columns.
3 Type a value in the Number of columns box.
4 In the Type of columns area, enable one of the following options:
Newspaper makes text flow down a column to the bottom of a page or
column break and continues it at the top of the next column
Balanced newspaper adjusts newspaper columns so that columns are of
equal length
Parallel groups columns across the page in rows, and starts subsequent rows
below the longest column of the previous row
Parallel w/block protect keeps all rows of the columns together across page
breaks
26
button on
To discontinue columns
1 Click where you want columns to discontinue.
2 Click Format ` Columns.
3 Click Discontinue.
Press Ctrl + Enter to end one column and start the next column.
To navigate columns
To move to
Press
Alt + Home
Alt + End
Formatting pages
27
Formatting text
In WordPerfect, you can use a variety of formatting tools to control the look of text.
In this section, youll learn about
modifying font settings
copying the format of text
Using Corel RealTime Preview lets you view text fonts and sizes before you apply them.
For example, you can view text as it will display in various fonts before choosing which
is the most suitable. If you do not want to preview fonts and their sizes, you can disable
Corel RealTime Preview.
WordPerfect lets you format text using recent font settings, including the font and its
size. You can also change the default font and font size for the active document or for
all documents.
Formatting text
29
You can also change the font color by clicking the Font color
property bar, and clicking a color.
button on the
You can also change the underline font style by opening the Underline
picker on the property bar and clicking an underline style.
31
5 Drag the QuickFormat paintbrush pointer over the text to which you want to
copy the format.
6 Click Format ` QuickFormat.
QuickFormat is disabled when no check mark displays beside the QuickFormat
menu command.
You can also enable or disable QuickFormat by clicking the QuickFormat
button.
Formatting text
33
Formatting paragraphs
WordPerfect allows you to control the look of documents by formatting paragraphs.
By changing the paragraph formatting, including justification, tab stops, and line
spacing, you can control the placement of paragraphs on a page.
In this section, youll learn about
indenting text
justifying text
changing the spacing between lines and paragraphs
adding tab stops
changing the alignment of tab stops
moving tab stops
removing and restoring tab stops
Indenting text
Indenting arranges text on a page by moving one or more lines to the left or the right
of the paragraph margin. You can indent a line or paragraph manually or you can indent
lines or paragraphs using the ruler or automatically.
To move the first line of a paragraph farther to the left than subsequent lines, you can
apply a hanging indent. To indent an entire paragraph one tab stop from both the left
and right margins, you can apply a double indent. A double indent is often used to
format lengthy quotations.
Formatting paragraphs
35
To remove an indent
1 Click at the beginning of a line of text.
2 Press Shift + Tab.
Justifying text
You can justify text in a document. Doing so aligns the text horizontally between the
left and right margins of the page.
36
To justify text
1 Click in a paragraph.
2 Click Format ` Justification, and click one of the following:
Left aligns text evenly with the left margin
Right aligns text evenly with the right margin
Center centers text between the right and left margins
Full aligns text, excluding the last line, along both the right and left margins
All aligns text, including the last line, along both the right and left margins
Justification is applied to all text from the cursor location forward. If you want
to apply justification to a word, line, or paragraph, you must first select the
text.
You can also justify text by clicking the Justification
property bar and clicking a justification.
Formatting paragraphs
picker on the
37
You can change the leading by changing the line spacing and changing the line height.
Formatting paragraphs
39
3 On the tab bar, which displays under the ruler, click where you want to add a tab
stop.
For the tab bar to appear, the ruler must be displayed.
40
41
5 Click Set.
42
Formatting paragraphs
43
Editing documents
After you create a document, you can edit it by using a variety of methods.
In this section, youll learn about
finding and replacing text
cutting, copying, and pasting text and graphics
copying and pasting text from a Web browser
moving text and graphics
reviewing documents
routing documents
comparing documents
controlling document comparisons
45
You can delete all occurrences of a text string by typing the text you want to
delete in the Find box and leaving the Replace with box empty.
You can search for a word or phrase you searched for previously by choosing
the word or phrase from the Find list box.
46
47
Do the following
You can also copy, cut, or paste text or graphics by clicking Copy
or Paste on the toolbar.
, Cut
You can link copied information to a document by enabling the Paste link
option. The changes you make to the linked information in the active file are
48
reflected in the original file. The changes made to the original file also appear
in the active file.
Editing documents
49
Reviewing documents
Using WordPerfect, you can send a document to a reviewer, or multiple reviewers, to
add changes or make revisions to the document. These changes and revisions are also
referred to as annotations. If you authored the document, you can open it to accept or
reject the annotations.
If you send the document to multiple reviewers, the annotations of each reviewer are
displayed in a unique color. All revisions are displayed as strikeout text
, and
comments are displayed as redline text. However, you can modify the way annotations
are displayed. For more information about modifying the display of annotation text, see
Changing the settings for document review and comparison in the online Help.
To review a document
1 Click File ` Document ` Review.
2 Click Reviewer.
3 Type your name in the User name box.
4 Type your initials in the User initials box.
5 Open the color picker on the feature bar, and click a color. All changes you make to
the document are displayed in the color you choose.
To avoid choosing the same color as another reviewer, view the color selections of
other reviewers by choosing their names from the Reviewer list box.
6 Edit the document.
7 Click File ` Save.
50
8 Click Close.
You can use all WordPerfect features except Sort to edit a document. Only
text editing changes, however, are marked with a color.
You can edit the additions made by previous reviewers; however, you cannot
edit or undo the deletions made by previous reviewers.
Editing documents
51
changes are incorporated before you save the document to a different file
format.
You can also incorporate a reviewers changes in a subdocument by clicking in
the subdocument and then clicking the Next button to move from change
to change.
Routing documents
Routing a document allows you to send a document for an online review to several
reviewers in a specified order. In this routing process, the document is sent to one
reviewer at a time, so that each reviewer sees the changes made by each of the previous
reviewers. When you route a document, it is inserted in an e-mail as an attachment. You
must have an e-mail client, such as WordPerfect MAIL, installed on your computer for
this option to work.
To route a document, you must create a routing slip. The routing slip allows you to
specify the recipients of the document and the order in which they will receive the
document.
A reviewer who receives a routed document can make changes and revisions to the
document. The reviewer can then save the changes, close the document, and send it to
the next reviewer listed on the routing slip. Alternatively, a reviewer can wait before
sending the document to the next reviewer or can reassign a routed document to
another reviewer listed on the routing slip.
When you create the first routing slip for a document, the e-mail address
specified in the environment settings automatically appears in the Authors email address text box. If you insert a different e-mail address in the box, the
new e-mail address becomes the default address the next time you create a
routing slip for the same document. If you enable the Store as default address
check box, this e-mail address appears every time you create a routing slip.
If you are using WordPerfect MAIL as the e-mail client and you want to add
addresses from the WordPerfect MAIL address book, you need to access these
addresses through the WordPerfect address book. When you click the
Addresses button, the WordPerfect address book opens, and the
WordPerfect MAIL address book item appears in the Tree view pane.
53
Comparing documents
You can compare a current version of a document with an earlier version to see what
changes have been made. When comparing documents, you can generate a comparison
summary and a list of changes. A comparison summary describes the color and the
attributes used to display deletions and insertions. It also lists the number of deletions,
insertions, and moves that were made. The list of changes details all of the changes
made in the document.
When you compare and review a document, the document that contains the
comparison markings is opened in review mode. In addition, you can restore a
document to the way it was before the comparison. For more information about
reviewing documents, see Reviewing documents on page 50.
To compare a document
1 Click File ` Document ` Compare.
2 In the With box, type the folder and filename of the file you want to compare.
To browse for the file, click the Browse button.
3 In the Show markings in area, enable one of the following options:
New document displays comparison results in a new document
Current document displays comparison results in the active document
4 Click Compare only.
54
To restore a document
1 Click File ` Document ` Remove markings.
Editing documents
55
Editing documents
57
To insert a footnote
1 Click where you want the footnote reference mark to display.
Working with footnotes and endnotes
59
To insert an endnote
1 Click where you want the endnote reference mark to display.
2 Click Insert ` Footnote/Endnote.
3 Enable the Endnote number option.
4 Click Endnote placement.
5 Enable the Insert endnotes at insertion point option.
6 Click Create.
7 Type the endnote text.
If you want to align the endnotes with the document margins, enable the Align
with document margins check box.
8 Click File ` Close.
While working with a endnote, you do not have access to all the available
WordPerfect functions until you return to the body of the text.
60
You can restart the endnote numbering at a specific number by typing the
number in the Endnote number box. When you enable the Insert endnotes
at insertion point and restart numbering option, all endnotes up to the
number youve specified display on one page, and then a note numbering starts
over with 1 on a new page.
You can restore a deleted footnote number by clicking the Note number
button on the property bar.
To find a footnote
1 Click Insert ` Footnote/Endnote.
2 Enable the Footnote number option.
3 In the Footnote number box, type the number of the footnote you want to find.
4 Click Edit.
To find an endnote
1 Click Insert ` Footnote/Endnote.
2 Enable the Endnote number option.
3 In the Endnote number box, type the number of the endnote you want to find.
4 Click Edit.
61
62
63
If you want to include a continued... message on the last footnote line of a page
and the first footnote line of a new page, enable the Insert (continued...) message
check box.
64
Numbering
WordPerfect allows you to count elements of a document. You can also change the
appearance of numbering and use counters to count elements of a document.
WordPerfect allows you to number pages and change the appearance of numbering.
In this section, youll learn about
numbering pages
changing the appearance of page numbers
Numbering pages
WordPerfect allows you to insert page numbers in a document and to choose where to
position page numbers on a page. When you begin page numbering, you can also
specify which number to begin with. For example, you may want the first page of a
document to be labeled page 3 instead of page 1.
You can also insert secondary page numbers, which allow you to start a new page
numbering scheme in a document. For example, suppose you are creating a document
in WordPerfect, but in the middle of the document, you need to add maps that were
not created in WordPerfect. The WordPerfect document is 10 pages, but the maps need
to be added as pages 7 and 8. To accomplish this, you can start page numbering at 1 at
the beginning of the document and insert a secondary page number, number 9, on the
documents page 7. This would allow for the addition of the maps without disrupting
the page numbering.
Numbering
65
These are examples of various page numbering options: 1) no page number, 2) page
number in the bottom-right corner, 3) page number at the bottom center, and 4) page
number in the top-right corner.
3 Click Value/Adjust.
4 In the Values dialog box, click the Secondary tab.
5 Choose a numbering format from the Secondary page number method list box.
6 Type a value in the Set secondary page number box.
7 Click Insert.
67
68
Printing
WordPerfect allows you to print a variety of documents, including envelopes and
labels.
In this section, youll learn about
setting up a printer
setting up a print job
previewing a print job
printing documents
controlling a print job
printing double-sided pages
printing document sections and comments
printing file details
printing envelopes and labels
printing graphics
laying out a print job
saving print settings
using printer commands
printing to a file
sending faxes
For more information about printing, see Reference: Printing on page 93.
Setting up a printer
If you have access to different printers, you can set them up in the application so you
can print to any of them, and, before printing a file, you can choose the printer you want
use. Once you install one or more printers, you can configure them in a number of ways.
You can also select a printer as the default printer for WordPerfect. In addition, you can
change printer properties and reformat documents for the default printer.
Printing
69
For more information about installing a printer, refer to the Windows documentation.
In addition, many printer settings are printer-specific; therefore, not all printer settings
may be available for your printer. Consult your printer manual for more information.
You can also disable printer metrics. Printer metrics are used to determine line endings.
If you disable printer metrics, printer fonts will not be visible in the list of fonts.
To add a printer
1 Click File ` Print.
2 On the Main page, click Printers.
3 In the Printers and faxes or Printers dialog box, double-click the Add printer
icon.
4 Follow the steps in the Add printer wizard.
To select a printer
1 Click File ` Print.
2 On the Main page, choose a printer from the Name list box.
are automatically updated every time you choose Application default setting.
This works only for the printer saved as the application default printer.
Printing
71
72
3 In the Advanced options area, choose one of the following options from the Paper
feed list box:
Left specifies that the paper is being inserted at the left of the printer
Center specifies that the paper is being inserted at the center of the printer
Right specifies that the paper is being inserted at the right of the printer
button in
Printing
73
Most printers have an area around the edge of the page where they cannot
print. WordPerfect does not allow smaller margins than your printer can
accommodate.
If you want to change the margins for specified text, select the text.
74
Printing documents
In addition to printing a file, you can print multiple copies of a file and print a document
saved on disk or on a network drive.
To print a document
1 Click File ` Print.
2 On the Main page, choose a printer from the Name box.
3 In the Print range area, enable one of the following options:
Full document prints the entire file
Current page prints the page where the cursor is located
Pages prints the pages specified in the page box
Selected text prints the selected text in the document (available only if text is
selected)
Document summary prints only the document summary (available only if
there is a document summary)
If you enables the Pages option, type the pages you want to print in the Pages box.
A hyphen (-) between numbers defines a range of sequential pages (for example, 15 prints pages 1 to 5). A comma (,) between numbers defines a series of nonsequential pages (for example, 1, 5 prints pages 1 and 5 only). Any combination of
hyphens and commas is supported (for example, 1-3, 5, 7, 10-12 prints the
following pages: 1, 2, 3, 5, 7, 10, 11, and 12).
4 Click Print.
For information about printing specific pages, see Printing multiple pages on
page 93.
If there is no document summary created for the document you are using, the
Document summary option is grayed. For information about creating
document summaries, see Using document summaries in the online Help.
75
3 Click Print.
76
absence of a check mark next to the Hide completed jobs command indicates
that the command is disabled.
Printing
77
4 Click Print.
5 When printing is complete, turn the pages over and reload them in the paper tray.
6 Repeat steps 1 to 4.
Before printing, you may want to print a double-sided test page.
Some printer manufacturers discourage reinserting a page into the printer if it
has been used for printing. Please refer to your printer documentation for more
information.
To print a booklet
1 Click File ` Print.
2 Click the Layout tab.
3 In the Two-sided printing area, enable the Use document settings option.
4 Enable the Print as booklet check box.
5 Click Print.
The booklet option is available only when the document has divided pages.
In order to print a booklet properly, the physical page must be subdivided into
two logical pages. For information about dividing pages, see Specifying singlesided or double-sided pages for a document in the online Help.
Printing
79
To print a comment
1 Click immediately after the comment.
2 Click Insert ` Comment ` Edit.
3 Click File ` Print.
Any comments that have been converted to document text will print when the
document is printed.
80
Printing
81
When you print codes in a document, the printed document does not contain
any information other than the codes and the text. For example, graphics and
file information are not printed.
For information on displaying Reveal Codes, see Using Reveal Codes on
page 16.
To print an envelope
1 Click the page of a document that is set up as an envelope.
2 Click File ` Print.
3 Click the Main tab.
4 Click Print.
You can also print an envelope by clicking the Print current envelope
button on the property bar.
To print a label
1 Click File ` Print.
2 Click the Advanced tab.
3 In the Page(s)/Label(s) list box, type the number of each label or a range of labels.
For example, to print label 3, type 3; to print labels 3 and 8, type 3, 8; to print
label 3 through the end of the document, type 3-.
4 Click Print.
The screen changes so that the first label is displayed and the rest of the
document window is shaded. As you fill the labels with text, more label pages
display in the window.
Labels that reach the edge of the sheet may not print correctly on printers with
a wide nonprinting zone. You must adjust the label size to account for the
printers nonprinting zone. Also, printing the same label on different printers
may give different results.
Printing graphics
The appearance of the graphics you print is determined partly by a process called
dithering, which combines several differently colored pixels to create a new color or
shade. With WordPerfect, you can change the dither method, the dither source, and
halftone options for printing graphics. For more information about dithering, see
Dithering methods on page 95.
83
84
85
86
87
5 Enable the Use printer properties from currently selected printer check box.
6 Enable the Save current printer properties with setting option.
When you enable the Save current printer properties with setting option, the
current printer properties are retrieved before saving, but they are not retrieved
from the printer every time the setting is retrieved. Therefore, if the printers
settings change, the settings you save do not change.
7 Click Save.
If you disable any or all of the following check boxes: Number of copies,
Collate, Two-sided printing, or Print in color, the settings are not retrieved
from the printer and the settings specified in the Print dialog box are not
saved. In order for the settings to be retrieved from the printer, the printer
must have the specified settings available.
If you disable a settings check box in the Settings to save list, the setting is
not saved.
Printing
89
You cant delete the Application default settings. You can, however, restore
the Application default factory settings. For more information about
restoring the Application default settings, see To restore the application
default print settings on page 90.
Printing to a file
You can print to a file instead of to a printer. This is useful if you dont have a printer
attached to your computer, or if you want to print the document on a printer other than
the one attached to your computer.
For more information about printing files to disk, see Printing to files on page 96.
To print to a file
1 Click File ` Print.
2 On the Main page, choose a printer from the Name list box.
3 Enable the Print to file check box.
4 Click Print.
5 In the Print to file dialog box, choose the drive and folder where you want to save
the file.
6 Type the name for the file in the File name box.
7 Click Save.
When you print to a file, you can print directly from DOS to the printer it was
formatted for. For example, if the file you printed to is named LETTER, saved
Printing
91
to C:\, and the computer you are using is printing to LPT1, type copy/b
c:\letter at a DOS prompt, then press Enter. You can also print the file using
the DOS Print command. See the DOS reference manual for more information.
Sending faxes
If the fax driver for your modem is installed, you can fax a file to others. For information
about installing fax drivers, consult the documentation included with your fax program.
Before you can send a fax, you must select a fax driver.
When you send a fax, you can choose to fax the entire file or fax only specific pages or
sections.
You can monitor the progress of a fax and view a list of the faxes sent during the current
session. You can pause a fax. When you pause a fax, any other faxes in the list continue
to transmit.
To send a fax
1 Click Send to ` Fax.
2 On the Main page, choose a fax driver from the Name list box.
3 In the Print range area, enable one of the following options:
Full document sends the entire document
Current page sends the page where the cursor is located
Pages sends the range of pages specified in the page box
Selected text sends the selected text in the document (only available if text is
selected)
Document summary sends only the document summary (only available if a
summary is created)
4 Click Fax.
Your fax program should open to guide you through the faxing process.
92
To pause a fax
1 Click File ` Print.
2 On the Main page, click Status.
3 In the Print history and status dialog box, choose a fax from the document list.
4 Click Document ` Pause printing.
A check mark beside the Pause printing command indicates the fax is paused.
You can also
Resume sending a fax
Cancel a fax
Fax jobs display in the order they were sent, with the current job at the top of
the list.
Reference: Printing
This topic provides additional information about printing multiple pages, printing
sections, printing labels, dithering methods, printer commands, and printing
WordPerfect files to a disk.
Type
Pages 3, 5, and 8
3,5,8
Pages 3 and 8
3,8
3-
-3
1-3,8
Printing
93
3,5,9-15
You must type the page numbers in numerical order. For example, if you type 10, 1, 2,
only page 10 will print. You can also print pages in reverse order. For more information
about printing pages in reverse order, see To print document pages in reverse order
on page 72.
Printing sections
You can specify the current page, chapter, or volume number in a document and then
print specific pages from each section.
For example, suppose a document has sections and page numbers as listed in the table
below.
Section
Pages
Preface
i-vii
Chapter 1
1-12
Chapter 2
1-20
Chapter 3
1-10
Index
i-iii
Some examples for printing sections of this document are listed in the table below.
If no number is specified in the Volumes, Chapters, and Secondary pages list
boxes, the first page of the document matching the page number (in Roman or
Arabic) is printed.
A hyphen (-) between numbers defines a range of sequential pages (for
example, 1-5 prints pages 1 to 5). A comma (,) between numbers defines a
series of non-sequential pages (for example, 1, 5 prints pages 1 and 5 only).
Any combination of hyphens and commas is supported (for example, 1-3, 5, 7,
10-12 prints the following pages: 1, 2, 3, 5, 7, 10, 11, and 12). A colon
between numbers defines a specific page number, where the first number
indicates the chapter, and the second indicates the page (for example, 2:3
prints chapter 2, page 3).
94
For more information about numbering pages, see Inserting chapter, volume,
and page total numbers in the online Help.
Printing labels
Labels are set up in WordPerfect so that you can print to portions of a page. Essentially,
label printing is set up in the same way as divided pages. The sheet or roll of labels is
called the physical page, and each individual label is called a logical page.
WordPerfect includes many label definitions that are commonly used or that match
commercially available labels. When you want to print labels or similar kinds of
projects, browse the list to see if there is one that meets your needs.
The default labels file for the United States, Canada, and other countries that use
Imperial measurements is Avery labels EN.LAB, where EN is the two-letter language
code (such as EN for English). The default labels file for countries that use the metric
system is Avery labels A4.LAB. You can print the document with the label definition
on another computer, but you cannot edit the definition itself.
Because the printer information is in the printer driver, the same document on a
different computer will not necessarily have the same printer information. This could
affect where information prints at the margin.
Dithering methods
Dithering places pixels with specific colors or values relative to other pixels of a specific
color. The relationship of one colored pixel to another creates the appearance of
additional colors that do not exist in the color palette.
With WordPerfect, you can control both the dithering method and the dithering source.
Provided your printer supports these options, you can:
choose one of three color or grayscale blending methods (error diffusion, ordered
dither, or halftone)
have dithering applied by WordPerfect or by your printer
Error diffusion scatters pixels irregularly, making edges and colors softer. Ordered
dithering approximates color blends using fixed dot patterns; as a result, solid colors are
emphasized and edges appear harder.
The halftone option is especially useful if you are making photocopies, since it can give
your original image sharper detail. If you choose halftone dithering, you can further
refine your selection, increasing the lines per inch (lpi) setting to increase image
Printing
95
sharpness and reduce gray shading. You can use the dither source to specify where the
bitmap or vector image is converted into the final format for printing. The image can
be converted by WordPerfect or the printer. If you are using a PostScript printer, you
can also specify the angle of line screening.
Printer commands
Printer commands vary according to the printer installed. Type printer commands using
the syntax documented in your printer manual. To include a decimal value for a control
code or character, enclose that value in angle brackets (such as <27> for ESC).
WordPerfect does not check that printer commands are valid. You will know that a
command in the document or printer command file is invalid or incorrect only if the
document fails to print correctly. If the text within a printer command is printed, this
means that the printer does not recognize it as a printer command. Check your printer
manual to be sure you have entered the command correctly.
Printing to files
If you are planning to send the file to a service bureau for printing, you can print it to
a file and then deliver the file to the service bureau on a disk or as an e-mail attachment.
The file can then be printed from another computer, whether or not that computer has
a copy of WordPerfect Office installed.
Printing files to disk creates a PostScript file when you have a PostScript printer
installed. PostScript is a page description language used to send instructions to a
PostScript device about how to print each page. All the elements in a print job (for
example, curves and text) are represented by lines of PostScript code that the printing
device uses to produce the document.
PostScript is not the only method for sending instructions to a printing device, and some
printing devices are not compatible with PostScript. However, there are several
functions that are unavailable if you are not using the PostScript printing device
language. For example, without PostScript, you cannot adjust color separations and
halftone screens.
96
Merging documents
When you merge documents, you combine a form document and a data source. The
merge produces varying copies of the form document, each containing information
from a specific record in the data source.
In this section, youll learn about
creating data for a merge
working with form documents for a merge
associating merge files
performing a merge
converting merge files
sorting, viewing, and finding data in data files
editing merge data files
selecting specific data for merges
merging with address books
changing merge options
using merge commands
merge programming commands
working with levels, loops, and merge variables
working with merge expressions
expression terms
You can program a merge by adding merge commands. For more information, see
Reference: The Merge toolbar and programming commands on page 184.
97
To use a WordPerfect data file as the data source, you can create either a data text file
or a data table file. In both types of data files, information is organized into records and
fields. For example, a record may include a name, address, telephone number, and other
contact information. Each item within the record, such as name or address, is recognized
as a field. It is recommended that you use no more than 512 fields per record.
When you create a data text file, each field is marked by the ENDFIELD code and each
record by the ENDRECORD code.
When you create a data table file, fields and records are arranged in columns and rows.
Each column contains a field. Each row contains a record.
This is an example of a data table file containing 1) records, 2) fields, and 3) field
names.
You can retrieve data from other file formats to use as data files in WordPerfect. For
example, you can retrieve and convert a database file, a spreadsheet file, an ODBC data
source, or a text file. For information about converting files, see Opening and
previewing files in the online Help.
You can also use an address book as a merge data source. For information, see Merging
with address books on page 117.
When you create a data file, WordPerfect automatically inserts a Merge toolbar into the
merge data file.
98
For more information about the Merge toolbar, see Using the Merge toolbar on
page 184.
Merging documents
99
It is recommended that you use no more than 512 fields per record.
To add a line to a field, press Ctrl + Enter.
Press Tab to move to the next field.
This is an example of a form document containing 1) FIELD codes where the name
and address of the recipient are inserted and 2) text for a letter.
At the top of the document window, WordPerfect inserts the Merge toolbar to give you
greater control over a merge. For more information about the Merge toolbar, see
Using the Merge toolbar on page 184.
WordPerfect lets you create a form document that you can personalize during a
keyboard merge. A keyboard merge lets you enter information into the form document
100
each time you need to send it. For more information about the KEYBOARD command,
see Merge programming commands on page 125. You also can create a form
document for labels and merged text that is oriented sideways.
If you do not want to create a new series of merged documents, you can send all of the
merged data to a table. After you perform the merge, all of the merged output will be
formatted into a single table with each column representing a field.
101
You can keep the Insert field name and number dialog box open and continue to
add information and formatting to the form document.
4 Click Insert.
103
8 On the Merge toolbar, click Insert merge code, and choose Keyboard.
9 In the Insert merge code dialog box, type a user prompt for the information to be
entered and click OK.
104
Merging documents
105
Performing a merge
When you merge documents, you combine a form document and a data source.
WordPerfect provides a variety of output options for the merged documents. For
example, you can save it to disk, print it, or add it to the active document.
You can perform a keyboard merge and add information at the time of the merge.
When you perform the keyboard merge, WordPerfect pauses the merge as specified in
the form document and waits for you to enter information from the keyboard.
You can create envelopes as you merge a form document (such as a letter), or you can
create merged envelopes on their own. An envelope is created for each record selected
in the data source. For more information about working with envelopes, see Creating
and editing envelopes in the online Help.
You can also send each merged document as e-mail.
Please note that it is recommended that you use no more than 512 fields per record.
To perform a merge
1 Click Tools ` Merge.
2 In the Merge dialog box, click Form document, and choose the location of the
form file to merge.
3 Click Data source, and choose the location of the data file to merge.
4 Click Output, and choose one of the following:
Current document
New document
Printer
5 Click Merge.
Merging documents
107
Press Esc.
You can also perform a keyboard merge by clicking Merge on the Merge
toolbar. For more information about using the Merge toolbar, see Using the
Merge toolbar on page 184.
To merge to envelopes
1 Click Tools ` Merge.
2 Click Form document, and choose the location of the form document.
If you are merging envelopes only, click Current document as the location of the
form file.
3 Click Data source, and choose the location of the data file.
4 Click Envelopes.
5 On the Merge toolbar, click Insert Field and insert fields in the form document.
6 Click Close.
7 Click Continue merge on the Merge toolbar.
8 Click Output, and choose a location for the merged file.
9 Click Merge.
The merged envelopes are placed at the end of the merged file.
If there is an existing envelope for this document, you can edit, cancel, or define
the envelope. For more information about creating envelopes, see Creating
and editing envelopes in the online Help.
To continue the merge to the end of the active record and ignore all other
merge commands, click Quit on the Merge toolbar.
To merge to e-mail
1 Click Tools ` Merge.
2 Click Form document, and choose the location of the form file to merge.
3 Click Data source, and choose the location of the data file to merge.
4 Click Output, and choose E-mail.
5 Choose the field containing the e-mail address from the Select field name of email address list box.
6 In the Subject line box, type the subject line for the merged e-mail message.
7 Click OK.
8 Click Merge.
9 Choose a profile from the Profile name list box.
Merging documents
109
111
It is recommended that you use no more than 512 fields per record.
Do the following
Add a field
Delete a field
It is recommended that you use no more than 512 fields per record.
Merging documents
113
Do the following
If you replace a field name, information in that field will be deleted from each
record in the data file. For example, if you replace Address with Street
Address, all data in the Address field in all records will be deleted.
If you delete a field name, information in that field will be deleted from each
record in the data file.
It is recommended that you use no more than 512 fields per record.
Merging documents
115
If you want to edit dimmed fields, enable the Allow editing of dimmed fields
check box.
3 Type text.
If you edit fields with functions, the functions are deleted.
For information about finding data in a data file, see Sorting, viewing, and
finding data in data files on page 111.
116
Reset conditions
Merging documents
117
You can also create a merge data file by using the records in an address book.
WordPerfect lets you create a data file by using all records or selected ones. When you
merge information from an address book, the records are interpreted as a merge data
file at the time of the merge. If you want to save address book information as a merge
data file, you can use the adrs2mrg.wcm macro included with WordPerfect. For more
information about macros, see Recordings, macros, and automation features on
page 191.
You can merge envelopes with a form document by using an address book. You can also
insert address book records as labels.
It is recommended that you use no more than 512 fields per record.
118
119
When you merge envelopes with an address book, you cannot add graphics to
the envelope. Only the return address, the recipients address, and a bar code
can be used. You can add extra text, such as Air Mail, below the return
address or above the recipients address. The extra text prints in the same font
as the addresses. For more information about creating envelopes, see Creating
and editing envelopes in the online Help.
The merged envelopes are placed at the end of the merged file.
9 In the Format address dialog box, choose a format from the Format list box.
Do the following
Merging documents
121
To
Do the following
If Reset is disabled in the Perform merge dialog box, all options (envelope,
form, and data) are set to the default.
Merge codes are displayed in red and the text you type is displayed in black.
You can customize a merge by inserting merge commands. For example, if you add the
DATE command to a letter, WordPerfect will replace the [DATE] code with the current
date. You can also delete, display, or hide merge commands.
122
WordPerfect performs a specific function for each merge command. Some codes are
accessible as buttons on the Merge toolbar. Other merge commands require careful
placement and the correct use of parameters and other commands.
The POSTNET command can be inserted into a form document. A POSTNET bar
code is a postal symbol used for addresses in the United States. WordPerfect inserts the
POSTNET bar code for the specified ZIP code. You can insert the same POSTNET bar
code for all of the records in a merge, or you can insert a different code for each record
in a data file.
123
124
To choose a field, you must have associated a data source with the form
document. If not, you can type the name of the field, making sure that it
matches the field name in the data source. For information about data sources,
see Associating merge files on page 105. For information about form
documents, see Working with form documents for a merge on page 100.
125
DATE
DEFAULT
DISPLAYSTOP
DOCUMENT(filename)
ELSE
EMBEDMACRO(macro statements)
ENDFIELD
ENDFOR
ENDIF
ENDRECORD
ENDSWITCH
ENDWHILE
FIELD(field)
FIELDNAMES(name1;...;nameN)
FIRSTCAP(expr)
FOREACH(var;expr1;...;exprN)
FORNEXT(var;start;stop[;step])
GETSTRING(var[;prompt][;title])
GO(label)
IF(expr)
IFBLANK(field)
IFEXISTS(var)
IFNOTBLANK(field)
INSERT(text)
KEYBOARD([prompt])
LABEL(label)
LOOK(var)
126
MRGCMND(merge codes)
NESTDATA(filename)
NESTFORM(filename)
NESTMACRO(macroname)
NEXT
NEXTRECORD
NTOC(number)
ONCANCEL(action)
ONERROR(action)
PAGEOFF
PAGEON
POSTNET(string)
PRINT
PROCESSOFF
PROCESSON
PROMPT(message)
QUIT
REPEATROW
RETURN
RETURNCANCEL
RETURNERROR
REWRITE
STATUSPROMPT(message)
STEPOFF
STEPON
STOP
STRLEN(expr)
Merging documents
127
STRPOS(expr;subexpr)
SUBSTDATA(filename)
SUBSTFORM(filename)
SUBSTR(expr;start;length)
SWITCH(expr)
SYSTEM(sysvar)
TOLOWER(expr)
TOUPPER(expr)
VARIABLE(var)
WAIT(10ths second)
WHILE(expr)
ASSIGN(var;expr)
Use ASSIGN to assign the value returned by expr to the global variable var. You do not
need to enclose the expression in quotes.
Expressions are evaluated, and the result is assigned to the variable.
Non-numeric characters and expressions that cannot be evaluated numerically are
treated as strings.
After a value has been assigned to a variable, the variable command VARIABLE(var)
can be placed anywhere you would normally place the variable contents. To erase a
variable (remove it from memory), leave the expr argument empty. For example, you
could use the command ASSIGN(Fred;) to erase a variable named Fred. When you
erase a variable, it no longer exists. For information, see IFEXISTS(var) on
page 148.
To assign a local variable, see ASSIGNLOCAL(var;expr) on page 169.
In the following example, the variable Fred is first assigned a value, then an expression,
then a string.
CODES(
ASSIGN(Fred;3)
Assign 3 to variable Fred.
128
ASSIGN(Fred;VARIABLE(Fred)*2)
Multiply old value of variable Fred by 2; assign the result (6) as the new value of
variable Fred.
ASSIGN(Fred;WordPerfect)
Assign the string WordPerfect to variable Fred.
VARIABLE(Fred)
Return the value of the variable to the document.
)
BEEP
Use BEEP to cause your computer to beep. This command is often useful in
combination with CHAR, KEYBOARD, PROMPT, STATUSPROMPT, and
GETSTRING, which prompt the user. You can also use it to signal various points of
the merge, such as the end of a lengthy process.
The following example sounds a beep at each keyboard pause. The user enters the
requested information, then clicks Continue on the Merge toolbar or presses Alt +
Enter (ENDFIELD) to continue to the next prompt.
MEMO
To: BEEP KEYBOARD(Enter To information)
From: BEEP KEYBOARD(Enter From information)
Date: DATE
Subject: BEEP KEYBOARD(Enter Subject information)
BREAK
Use BREAK to exit from a loop before it would normally end. The location of the
command and the type of file it is in determine how it functions.
The rules that govern how BREAK functions are listed below.
Each of the following rules assumes that the previous rules do not hold.
If BREAK is encountered within a FORNEXT or WHILE structure, execution
moves to the end of the structure (just after the ENDFOR or ENDWHILE). If
Merging documents
129
these structures are nested, execution moves after the ENDFOR or ENDWHILE
command of the current level.
If BREAK is encountered in a nested file, execution returns to the parent file.
If BREAK is encountered in a form file, the merge moves to the top of the form file
and continues with the next data record.
If BREAK is encountered in a data file, the merge is terminated.
The following example uses BREAK to exit an infinite loop when the correct number
is guessed.
CODES(
ASSIGN(Actual Number;SUBSTR(SYSTEM(random);3;1))
WHILE(1)
CHAR(Guess;Guess a number between 0 - 9?;Guessing Game)
IF(VARIABLE(Guess)=VARIABLE(Actual Number))
BEEP
PROMPT(Correct, the number was VARIABLE(Actual Number))
WAIT(30)
BREAK
ELSE
PROMPT(Sorry, the number wasnt VARIABLE(Guess))
WAIT(10)
ENDIF
ENDWHILE
)
CALL(label)
Use CALL to transfer execution to the label subroutine. When execution of the
subroutine is completed (when a RETURN is encountered in the subroutine), execution
returns to the command following CALL. For more information about subroutines and
labels, see Levels on page 170.
130
The example below is a form file that creates a data file. The Info subroutine is called to
get the information for each record.
GETSTRING prompts the user to enter information and assigns the information to a
variable. MRGCMND places the necessary merge codes into the data file being created.
When no name is entered for variable name, that variable is erased.
IFEXISTS then returns a false (0), and QUIT is executed, ending the merge.
CODES(
MRGCMND(FIELDNAMES(Name;Address;City;State;ZIP)ENDRECORD
====================================
)
WHILE(1)
CALL(Info)
VARIABLE(name)MRGCMND(ENDFIELD)
VARIABLE(address)MRGCMND(ENDFIELD)
VARIABLE(city)MRGCMND(ENDFIELD)
VARIABLE(state)MRGCMND(ENDFIELD)
VARIABLE(zip)MRGCMND(ENDFIELD)
MRGCMND(ENDRECORD)
====================================
ENDWHILE
LABEL(Info)
GETSTRING(name;Enter Name or choose Cancel to Quit;Name)
IFEXISTS(name)
ELSE
QUIT
ENDIF
GETSTRING(address;Enter Address;Address)
GETSTRING(city;Enter City;City)
Merging documents
131
GETSTRING(state;Enter State;State)
GETSTRING(zip;Enter ZIP Code;ZIP Code)
RETURN
)
CANCELOFF
Use CANCELOFF to stop the Esc key from performing its normal function.
CANCELOFF is useful to prevent a user from stopping a merge by pressing Esc.
CANCELOFF
(During this part of the merge, pressing Cancel does not end the merge.)
CANCELON
(During this part of the merge, pressing Cancel does not end the merge.)
CANCELON
Use CANCELON to enable the Esc key after it has been disabled with the
CANCELOFF command.
For an example of CANCELON, see CANCELOFF on page 132.
CAPS(expr)
Use CAPS to capitalize the first character of each word in the returned expression expr.
To change all letters in a returned expression to uppercase or lowercase, see
TOUPPER(expr) on page 168 or TOLOWER(expr) on page 168. To capitalize only
the first letter of the first word, see FIRSTCAP(expr) on page 144.
In the example below, CAPS capitalizes the first letter of each word in the name,
address, and city variables. TOUPPER capitalizes both letters of the state abbreviation.
FIRSTCAP capitalizes the first letter of the first word in the comments string.
TOLOWER ensures that the merge will continue if either an uppercase or a lowercase
y is assigned to VARIABLE(char).
CODES(
LABEL(info)
GETSTRING(name;Enter Name;Name)
132
ASSIGN(name;CAPS(VARIABLE(name)))
GETSTRING(address;Enter Address;Address)
ASSIGN(address;CAPS(VARIABLE(address)))
GETSTRING(city;Enter City;City)
ASSIGN(city;CAPS(VARIABLE(city)))
GETSTRING(state;Enter state abbreviation;State)
ASSIGN(state;TOUPPER(VARIABLE(state)))
GETSTRING(zip;Enter ZIP code;ZIP)
GETSTRING(comments;Enter comments;Additional Comments)
ASSIGN(comments;FIRSTCAP(VARIABLE(comments)))
VARIABLE(name)
VARIABLE(address)
VARIABLE(city) VARIABLE(state) VARIABLE(zip)
VARIABLE(comments)
====================================
CODES(
CHAR(char;Do Another Record?;Continue (Y/N)?)
IF(TOLOWER(VARIABLE(char)) = y)
GO(info)
ENDIF
)
CASEOF(expr[;...;expr])
Use CASEOF when using the SWITCH command. When you use CASEOF, you can
enter multiple merge expressions within the parentheses.
For examples of CASEOF, see SWITCH(expr) on page 166 and
FORNEXT(var;start;stop[;step]) on page 144.
Merging documents
133
CHAINDATA(filename)
Use CHAINDATA to begin using records from the named data file, when the end of
the current data file is reached. This command is especially useful if you have broken a
large data file into several smaller files. If you insert CHAINDATA in the smaller data
files, they will act like one data file.
The following example shows how a large data file has been broken into two smaller
files. When you specify the first small file as the data file in a merge, the records of the
second small file will be used as soon as those in the first small file are completed.
First Small File:
FIELDNAMES(name;status) ENDRECORD
====================================
PROCESSON CHAINDATA(file2)PROCESSOFF COMMENT(
The PROCESS commands ensure that the CHAINDATA command executes.
The merge stores the CHAINDATA command and filename, then executes it
when the current data file has ended.)
JoseENDFIELD
StaffENDFIELD
ENDRECORD
====================================
(additional records)
====================================
BarbaraENDFIELD
ProfessionalENDFIELD
ENDRECORD
Second Small File (named FILE2 in the default directory):
FIELDNAMES(name;status)
ENDRECORD
====================================
134
JulieENDFIELD
Part-timeENDFIELD
ENDRECORD
====================================
(additional records)
====================================
ShojiENDFIELD
Leave of AbsenceENDFIELD
ENDRECORD
====================================
CHAINFORM(filename)
Use CHAINFORM to continue the merge with an additional form file after all records
have been merged with the current form file.
The following example uses CHAINFORM to merge an envelope form file with the
current data file.
CHAINFORM(envelope.frm)
(body of form file)
CHAINMACRO(macroname)
Use CHAINMACRO to start the named macro at the end of the merge, if the merge
terminates normally. You can place CHAINMACRO anywhere in the form file.
Only the last macro chained during the merge is executed.
In the following example, the chained macro print.wcm executes when the merge is
complete.
CHAINMACRO(print)
COMMENT(Chain the macro PRINT.WCM when the merge is complete.)
DATE
Dear FIELD(Name),
Merging documents
135
CHAR(var[;prompt][;title])
Use CHAR to prompt the user to input a single character. CHAR prompts you with a
message and waits until you press a single key.
The pressed key is assigned to the specified variable var. Prompt is the information
displayed in the dialog box telling the user what to do.
Title is the title of the dialog box created during the merge.
For an example of CHAR, see CTON(character) on page 137.
CODES(merge codes)
Use CODES to enter merge codes and have the merge ignore any formatting or text
you might add. The merge carries out all the merge commands inside the CODES
parentheses but ignores any text or formatting (such as hard returns). To enter text or
formatting inside the CODES parentheses, use the INSERT command.
The following example shows a code that pauses the merge at each record and lets you
choose which records you want to merge.
CODES(
LABEL(top)
ASSIGN(field;FIELD(1))
EMBEDMACRO(
PERSIST(fld)
PROMPT(Which name would you like to merge? ; OK to merge +field+?;2)
PAUSE
ENDPROMPT
)
IF(VARIABLE(fld)=2)
136
INSERT(FIELD(1))
INSERT(FIELD(2))
INSERT(FIELD(3))
====================================
ENDIF
NEXTRECORD
GO(top)
)
For another example of CODES, see CTON(character) on page 137.
COMMENT(comment)
Use COMMENT to include comments that will make the merge easier to understand.
Merge ignores everything between the COMMENT parentheses.
For an example of COMMENT, see CTON(character) on page 137.
CONTINUE
Use CONTINUE at the end of a CASEOF statement to execute the commands in the
next CASEOF statement.
For examples of CONTINUE, see SWITCH(expr) on page 166 and
FORNEXT(var;start;stop[;step]) on page 144.
CTON(character)
Use CTON (Character to number) to convert a character (any character in the
WordPerfect character sets) to a unique number (its WordPerfect key value). CTON
performs the inverse (opposite) function of NTOC. You can use the key value to
calculate the WordPerfect character set value.
To calculate the character set value for a given character
1 Use CTON to obtain the key value.
2 Divide the key value by 256.
The quotient is the number of the WordPerfect character set (012).
Merging documents
137
DATE
Use DATE to insert the current date in merged documents, as formatted in the Date
format feature. The merged file will contain the current date as indicated by your
computers internal clock.
For an example of DATE, see BEEP on page 129.
DEFAULT
Use DEFAULT with the SWITCH command to cover all cases not covered by
CASEOF. When the expression being tested is different from all the CASEOF
expressions, the merge executes DEFAULT.
For examples of DEFAULT, see SWITCH(expr) on page 166 and
FORNEXT(var;start;stop[;step]) on page 144.
138
DISPLAYSTOP
Use DISPLAYSTOP to stop the display of text after a KEYBOARD command. For
example, after a KEYBOARD command, the merge displays as many as 1000
characters ahead. DISPLAYSTOP placed in text after KEYBOARD stops the text
from displaying from that point on.
DATE
FIELD(name)
FIELD(address)
FIELD(city)
Dear FIELD(name):
It has come to our attention that your bill has not been paid. Please send us
$KEYBOARD(Enter how much they owe us Press Alt + Enter or choose Continue
when done), which is the balance of your unpaid account.DISPLAYSTOP
If the balance of your account is not paid in KEYBOARD(Enter how many days
Press Alt + Enter or choose Continue when done) days, we will be forced to take legal
action.DISPLAYSTOP
If you have already made arrangements to settle your account, please disregard this
notice.
The rest of the letter after DISPLAYSTOP does not display on the screen while the user
is prompted to type information at the keyboard.
This removes distracting information from the screen, so users can focus their attention
on the area where they are to enter information.
DOCUMENT(filename)
Use DOCUMENT to insert the named document into the merged document at the
DOCUMENT command. The document is not processed as a merge file, so any merge
commands in the inserted document are included in the file but not executed. This
command is commonly used for inserting variable paragraphs in contracts and similar
documents (often called document assembly) or for building a form or data file.
In the following example, DOCUMENT inserts the document called oneroom.mrg in
the merged document if the variable rooms is equal to 1, or it inserts the document
tworooms.mrg if the variable rooms is not equal to 1.
Merging documents
139
CODES(
CHAR(rooms;Enter the number of rooms (1 or 2); Number of Rooms)
IF(VARIABLE(rooms)=1)
DOCUMENT(c:\mrgfiles\oneroom.mrg)
ELSE
DOCUMENT(c:\mrgfiles\tworooms.mrg)
ENDIF
)
ELSE
Use ELSE with IF, IFBLANK, IFEXISTS, IFNOTBLANK, and ENDIF. ELSE
marks the beginning of the commands that execute should the IF value be zero (false).
ELSE is not a required part of an IF statement. It should be used when there are certain
steps that need to be performed only when the IF value is zero (false).
Commands that appear after ENDIF execute whether or not the IF value is true.
For an example of ELSE, see DOCUMENT(filename) on page 139.
EMBEDMACRO(macro statements)
Use EMBEDMACRO to embed macro commands within a merge. You can enter any
macro command inside the EMBEDMACRO parentheses. The macro commands are
compiled the first time they are encountered during the merge.
For an example of EMBEDMACRO, see CODES(merge codes) on page 136.
ENDFIELD
Use ENDFIELD to signal the end of a field in a data file. A hard return [HRt] is
automatically inserted with this command to make the file easier to read.
When you insert this command, the number of the field where the cursor is currently
located displays at the bottom of the window. If you use FIELDNAMES, the name of
the field appears instead of the number.
Records in the following data file have three fields:
140
International ExportingENDFIELD
(801) 555-4421ENDFIELD
George WileyENDFIELD
ENDRECORD
====================================
Tradewinds, Inc.ENDFIELD
(409) 555-3567ENDFIELD
Susan EscherENDFIELD
ENDRECORD
====================================
ENDFOR
Use ENDFOR to signal the end of FORNEXT and FOREACH loops.
For an example of ENDFOR, see FORNEXT(var;start;stop[;step]) on page 144.
ENDIF
Use ENDIF to mark the end of an IF structure. ENDIF is used with IF, IFBLANK,
IFEXISTS, IFNOTBLANK, and ELSE.
For an example of ENDIF, see DOCUMENT(filename) on page 139.
ENDRECORD
Use ENDRECORD to signal the end of a record in a data file. A hard page break is
inserted automatically with this command to make the file easier to read.
When you insert this command, the number of the field where the cursor is currently
located displays at the bottom of the window. If you use FIELDNAMES, the name of
the field appears instead of the number.
For examples of ENDRECORD, see ENDFIELD on page 140 and
FIELDNAMES(name1;...;nameN) on page 142.
Merging documents
141
ENDSWITCH
Use ENDSWITCH to end a SWITCH statement.
For an example of ENDSWITCH, see SWITCH(expr) on page 166.
ENDWHILE
Use ENDWHILE to signal the end of a WHILE loop.
For an example of ENDWHILE, see NEXTRECORD on page 153.
FIELD(field)
Use FIELD to insert the contents of the named (or numbered) field in the merged
document or in another merge command.
In the following example, the contents of the name and address fields are inserted in the
letter.
FIELD(name)
FIELD(address)
Dear FIELD(name):
For additional examples of FIELD, see DISPLAYSTOP on page 139.
FIELDNAMES(name1;...;nameN)
Use FIELDNAMES to declare the names and order of the fields in a data file. Using
this command in the data file allows you to reference the fields by name in a form file,
which is usually easier than remembering the order of the fields and referencing them
by number.
WordPerfect places FIELDNAMES at the top of the data file. It must be located at the
top of the file to work correctly. If records have more fields than those declared in
FIELDNAMES, additional fields are numbered. When initially inserted, the command
and field names are all on one line. You may find it easier to read if you put each field
name on a separate line, as in the example below. A hard page code [HPg] is
automatically inserted when you insert ENDRECORD.
After you insert this command, the name or number of the field where the cursor is
currently located displays on the status bar at the bottom of the window.
142
In the following example, the first three fields of each record are named using
FIELDNAMES. The additional fields are not named and are therefore numbered Field
4, Field 5, and so on.
FIELDNAMES(
company;
phone;
contact;
)ENDRECORD
====================================
International ExportingENDFIELD
(801) 555-4421ENDFIELD
George WileyENDFIELD
FurnitureENDFIELD
45ENDFIELD
$1.5 millionENDFIELD
ENDRECORD
====================================
Tradewinds, Inc.ENDFIELD
(409) 555-3567ENDFIELD
Susan EscherENDFIELD
MemorabiliaENDFIELD
200ENDFIELD
$2.0 millionENDFIELD
ENDRECORD
====================================
For another example of FIELDNAMES, see CHAINDATA(filename) on page 134.
Merging documents
143
FIRSTCAP(expr)
Use FIRSTCAP to capitalize the first letter of the first word in the returned expression
expr.
For an example of FIRSTCAP, see CAPS(expr) on page 132.
FOREACH(var;expr1;...;exprN)
Use FOREACH to assign a list of items to one variable var. The merge then executes
the subsequent commands for each expr listed in FOREACH, changing var to the next
value at the end of each loop.
For example, the following codes assign different days of the week to the variable
weekday until it matches the field day.
FOREACH(weekday;Monday;Tuesday;Wednesday;Thursday;Friday)
IF(VARIABLE(weekday)=FIELD(day))
BREAK
ENDIF
ENDFOR
FORNEXT(var;start;stop[;step])
Use FORNEXT to execute a series of commands a certain number of times. The
commands between FORNEXT and ENDFOR are executed once for each value of var
between start and stop inclusive, as incremented by step.
The start, stop, and step values can be entered in the command as expressions, variables,
or other commands. Each expression, variable, or command is evaluated, and the
resulting value is assigned to the variable. The step value is optional; its default value is
1 (or -1, if stop is less than start).
In any FORNEXT loop, ENDFOR must be used to determine the end of the series of
commands included in the loop. ENDFOR sends execution to the top of the loop for
the next iteration. You can also use NEXT to send execution to the next iteration, but
you must still include ENDFOR to mark the end of the loop.
FORNEXT initializes the variable with the start value. If the variable has not been
assigned, it is defined as a local variable. You do not need to pre-assign the variable.
144
Each subsequent time FORNEXT is executed (at the top of the loop), the variable is
incremented by the step value.
The example below uses a FORNEXT loop to apply a SWITCH statement once for
each character in the sentence that is entered.
CODES(
GETSTRING(sentence;Type a sentence;Sentence To Be Evaluated)
ASSIGN(vowels;0)
ASSIGN(consonants;0)
ASSIGN(misc;0)
FORNEXT(i;1;STRLEN(VARIABLE(sentence));)
SWITCH(TOLOWER(SUBSTR(VARIABLE(sentence);VARIABLE(i);1)))
CASEOF(a;e;i;o;u)
ASSIGN(vowels;VARIABLE(vowels)+1)
CASEOF(b;c;d)
CONTINUE
CASEOF(f;g;h;)
CONTINUE
CASEOF(j;k;l;m;n)
CONTINUE
CASEOF(p;q;r;s;t)
CONTINUE
CASEOF(v;w;x;y;z)
ASSIGN(consonants;VARIABLE(consonants)+1)
DEFAULT
ASSIGN(misc;VARIABLE(misc)+1)
ENDSWITCH
ENDFOR
Merging documents
145
)
There were:
VARIABLE(vowels) vowels,
VARIABLE(consonants) consonants, and
VARIABLE(misc) other characters.
GETSTRING(var[;prompt][;title])
Use GETSTRING to prompt the user by displaying a dialog box.
Information returned by the dialog box is assigned to the variable var.
Prompt is the information displayed in the dialog box telling the user what to do.
Title is the title of the dialog box created during the merge.
For an example of GETSTRING, see CAPS(expr) on page 132.
GO(label)
Use GO to transfer execution to the location in the merge file indicated by label. It is
used in conjunction with LABEL, which marks the place to which execution is
transferred.
GO is useful when you want to skip a part of your merge or transfer control to another
part based on a condition. Unlike CALL, GO does not require the merge to return to
that point of execution.
For an example of GO, see CAPS(expr) on page 132.
IF(expr)
Use IF to execute a set of commands only if a certain condition exists.
If the condition exists (expr is evaluated to be true), the commands between the IF and
ENDIF are executed. If an ELSE is included, the commands between the IF and ELSE
are executed if the expression is true; otherwise, the commands between the ELSE and
ENDIF are executed.
The expr argument is usually a logical expression. An expression is true if it is evaluated
as a non-zero number. For example, when the expression 4=4 is evaluated, the result is
146
IFBLANK(field)
Use IFBLANK to execute a set of commands if the indicated field is blank. Be sure to
end the set of commands to be executed with an ENDIF command. See also
IFNOTBLANK(field) on page 148.
In the following example, the data file records have a Title field and a Name field. The
merge determines if the Title field of the current record is blank. If it is blank, only the
name is inserted in the merged document. Otherwise, the merge inserts the title before
the name.
CODES(
IFBLANK(title)
If the Title field is blank in this record,
INSERT(FIELD(name))
Write out just the Name.
ELSE
Otherwise,
INSERT(FIELD(title) FIELD(name))
Write the Title before the Name.
ENDIF
End of IFBLANK statement.
)
Merging documents
147
IFEXISTS(var)
Use IFEXISTS to check if the indicated variable has been defined. If it has, the
commands following IFEXISTS are executed. Like other IF statements, IFEXISTS
requires an ENDIF and can use an ELSE command.
The following commands could be placed at the end of any form file.
They cancel the merge if any key is pressed.
LOOK(Key)
IFEXISTS(Key)
STOP
ENDIF
IFNOTBLANK(field)
Use IFNOTBLANK to execute a set of commands if the indicated field is not blank.
Be sure to end the set of commands to be executed with an ENDIF command. See also
IFBLANK(field) on page 147.
In the following example, the data merge file records have a Title field and a Name field.
The merge determines if the Title field of the current record is blank. If it is not, the
title is inserted before the name. Otherwise, the merge inserts only the name.
CODES(
IFNOTBLANK(title)
If the Title field is not blank in this record,
INSERT(FIELD(title) FIELD(name))
Write the Title before the Name.
ELSE
Otherwise,
INSERT(FIELD(name))
Write out only the Name.
ENDIF
End of IFNOTBLANK statement.
148
INSERT(text)
Use INSERT to enter text or formatting inside a CODES command.
For example, the merge will not recognize a hard return inside the CODES parentheses.
To make the merge return a hard return, use INSERT, then press hard return.
For examples of INSERT, see IFNOTBLANK(field) on page 148 and
NESTMACRO(macroname) on page 151.
KEYBOARD([prompt])
Use KEYBOARD to pause an executing merge so the user can enter information from
the keyboard. As many as 1,000 characters of the form file are displayed. Merge codes
are displayed using the current display setting. The merge continues when you click
Continue on the Merge toolbar or press Alt + Enter (ENDFIELD).
While an executing merge is paused at KEYBOARD, you can execute QUIT,
NEXTRECORD, or STOP from the keyboard.
In the following example, the KEYBOARD commands pause to let you enter the
From:, To:, and Subject: text as the merge is executed.
MEMO
To: BEEP KEYBOARD(Enter To information)
From: BEEP KEYBOARD(Enter From information)
Date: DATE
Subject: BEEP KEYBOARD(Enter Subject information)
If KEYBOARD is executed within another merge command, a dialog box displays with
the indicated prompt. You cannot execute commands from the keyboard, but any text
entered at the prompt is inserted into the merged document.
LABEL(label)
Use LABEL to mark a place in the merge file. Execution can be sent directly to the label
from any place in the merge file. CALL and GO are used to send execution to the label.
Merging documents
149
The label name distinguishes one label from another. Label names can be as many as 30
characters long, including spaces. Different labels in the same merge file must have
different names. If a name is duplicated, the first one is used, and the other is ignored.
Do not assign a label and a local variable the same name, or the merge may not function
properly.
For examples of LABEL, see CALL(label) on page 130 and CAPS(expr) on
page 132.
LOOK(var)
Use LOOK to determine if a key has been pressed. If it has, that key is assigned to the
variable; it is not executed. If no key has been pressed, the variable is deleted; execution
continues without stopping.
For an example of LOOK, see IFEXISTS(var) on page 148.
MRGCMND(merge codes)
Use MRGCMND to insert text, codes, and commands in the document being created
by the merge. Any text, codes, or merge commands that appear between the
MRGCMND parentheses are sent directly to the merged document without the
commands being interpreted or executed.
For an example of MRGCMND, see CALL(label) on page 130.
NESTDATA(filename)
Use NESTDATA to interrupt the use of the current data file and switch to another data
file during the merge. The parent data file then continues only when the merge on the
nested data file has been completed. You can nest data files as many as 10 levels deep.
For information, see Levels on page 170.
If you nest from within one data file to another, be careful to avoid infinite loops. Use
CANCEL or BREAK to terminate the loop.
When you nest a data file, the switch to that file occurs immediately.
When you chain data files, the switch to the new data file is made when the end of the
current data file is reached. For more information, see CHAINDATA(filename) on
page 134.
For an example of NESTDATA, see NESTFORM(filename) on page 151.
150
NESTFORM(filename)
Use NESTFORM to turn control of the merge over to another form file. When the
commands in the nested file have been executed, control returns to the original form
file, where execution resumes after NESTFORM. For information on how to change the
data file, see NESTDATA(filename) on page 150.
You can nest form files as many as 10 levels deep. Using NESTFORM without
specifying a filename is the same as using SUBSTFORM with the current form
filename as the argument. In this case, NESTFORM does not use one of the 10 nest
levels. For more information, see Levels on page 170.
FIELD(name),
It has been a pleasure serving you this year.
CODES(
IF(FIELD(balance)!=0)
NESTDATA(transact.dat)
NESTFORM(invoice.frm)
ENDIF
)
Sincerely,
NESTMACRO(macroname)
Use NESTMACRO to execute the named macro during a merge.
When the macro is finished, the merge continues with the code following
NESTMACRO.
Macros created in earlier versions of WordPerfect (before version 6.x) will need to be
converted.
The following example nests a macro that computes the interest on an account balance.
CODES(
ASSIGN(balance;FIELD(balance))
NESTMACRO(calcint)
INSERT(Interest on this balance is VARIABLE(interest))
Merging documents
151
NEXT
Use NEXT to execute the next iteration of a FORNEXT, FOREACH, or WHILE
loop. Usually, the ENDFOR or ENDWHILE that ends the loop sends execution to the
next iteration. However, you can use NEXT to send execution to the next iteration
from anywhere within the loop. For example, you may use nested IF statements as part
of the loop. Then, when a certain condition is true, execution will skip the rest of the
commands in the loop and go to the next iteration. In this case, you would use NEXT
at the point where you want the next iteration to begin.
Even if you use NEXT in a loop, you must still use an ENDFOR or ENDWHILE to
mark the end of the loop.
The following merge writes **********@@@@@.
CODES(
FORNEXT(i;1;15;1)
Repeat the loop 15 times, starting at 1, ending at 15, in
increments of 1.
IF(VARIABLE(i)10)
If variable i is greater than 10,
INSERT(@)
write an @,
NEXT
and skip to the next iteration of this FORNEXT loop.
ENDIF
INSERT(*)
Write an * each time the loop is completed.
ENDFOR
)
152
NEXTRECORD
Use NEXTRECORD to move the record pointer in the data file to the next record. If
it does not find the next record, it ends the merge or returns the merge to the previous
data file if the data file was nested.
While an executing merge is paused at KEYBOARD, you can execute
NEXTRECORD from the keyboard.
In this example, the data file is searched until the variable company name matches the
company field in the data file. When a match is found, the contents of the amount field
for that record in the data file are written to the merged document.
CODES(
WHILE(VARIABLE(Company Name)!=FIELD(Company))
NEXTRECORD
ENDWHILE
)
FIELD(Amount)
NTOC(number)
Use NTOC (Number to character) to convert a WordPerfect key value or character set
number to its character equivalent. It performs the inverse function of CTON. For
example, the NTOC of 294 is .
To calculate the key value for a given character set value
Multiply the character set number by 256, then add the number of the character.
For example, is character number 38 in Character Set 1.
Multiply 256 times 1 (256), then add 38 (294). The NTOC of 294 is .
NTOC will return nothing if you enter a number that is not equivalent to a character.
The following example prompts for a number, then returns the character equivalent.
GETSTRING(num;Enter a key value number;)
NTOC(VARIABLE(num))
Merging documents
153
ONCANCEL(action)
Use ONCANCEL to specify what the merge does if you press Esc (Cancel) or if a
RETURNCANCEL has been returned by a subroutine, a nested macro, or a nested
merge. When a Cancel occurs, the merge performs the default action (STOP) if it has
not already encountered the ONCANCEL command. For this reason, it is a good idea
to place the command before a Cancel can occur, otherwise execution will terminate
when Esc is pressed. If no action is specified in ONCANCEL, the Cancel is ignored, and
execution continues as if there has been no Cancel.
Valid actions available with this command are
BREAK
CALL
GO
QUIT
RETURN
RETURNCANCEL
RETURNERROR
STOP
When Esc is pressed, the last ONCANCEL command encountered in the file is
executed.
ONCANCEL is local to the file in which it is encountered. It cannot be used from other
files. For example, a data file cannot use ONCANCEL from a form file.
In the following example, if you press Esc during the merge, the end subroutine is
executed.
CODES(
ONCANCEL(GO(end))
If Esc is pressed during the merge, execute the End
subroutine.
(commands in form file)
STOP
LABEL(end)
Beginning of End subroutine.
154
ONERROR(action)
Use ONERROR to tell WordPerfect what to do if an error is detected in merge
execution or if a RETURNERROR has been returned by a subroutine or nested macro
or merge.
Inserting ONERROR without an action causes the merge to ignore the error and
continue execution when possible.
The errors that can be trapped with this command are
File not found
Print queue errors
End of file condition returned by a NEXTRECORD
If you chain a file that does not exist or is not found, the error condition is not generated
until the merge tries to execute the chained file (that is, at the end of the current merge
file). For more information, see also CHAINDATA(filename) on page 134,
CHAINFORM(filename) on page 135, and CHAINMACRO(macroname) on
page 135.
The default action is STOP. For a list of other possible actions, see
ONCANCEL(action) on page 154.
ONERROR is local to the file in which it is encountered. It cannot be seen from other
files. For example, a data file cannot use ONERROR from a form file.
In the following example, a new form file is nested. ONERROR specifies that
subroutine error be executed if the file is not found when the merge tries to nest it.
CODES( ONERROR(GO(error))
Merging documents
155
PAGEOFF
Use PAGEOFF to eliminate the hard page code [HPg] between copies of the form file
in the merged document. Use PAGEON to begin inserting hard page codes again after
you have used PAGEOFF.
PAGEON and PAGEOFF are global to the merge; they may be included in any form
or data file and are in effect for all the files in the merge until the opposite command is
encountered. PAGEOFF and PAGEON override the options set in the Merge Run
dialog box.
These commands are useful for merging labels or for including multiple records in a
document. You can also use PAGEOFF with PRINT to eliminate blank pages between
copies of the merged document when merging to the printer.
For an example of PAGEOFF, see PAGEON on page 157.
156
PAGEON
Use PAGEON to reinstate the use of hard page codes between copies of the form file in
the merged document. See also PAGEOFF on page 156.
In the example below, the nested form file, list.pf, creates a list of players on a given
team. The final result of the merge is a list of the players on each team, one team per
page.
CODES(
ASSIGN(team;FIELD(team))
Assign the current field to a global variable so that the nested
form file can use it.
INSERT(These people are on Team FIELD(team):)
PAGEOFF
This command prevents the insertion of a hard page between
iterations of the nested form file.
NESTFORM(list.frm)
This form file produces a list using the Name field of
all records whose Team field matches the current Team variable.
PAGEON
This command restores the use of page breaks to allow one team
list per page.
)
POSTNET(string)
Use POSTNET to insert a POSTNET bar code into a form file for letters, envelopes,
or labels. For the string parameter, you can type the bar code digits or enter a field for
the digits.
The following is a sample form file for an envelope including the return address and a
POSTNET bar code:
JASPER DEAN
Merging documents
157
PRINT
Use PRINT to send the current merged text to the printer. Once the text is sent to the
printer, it is no longer in the merged document.
When you merge to the printer using this command, the usual page break is still
inserted between each iteration of the form file. To eliminate the extra page between
each copy, insert PAGEOFF before PRINT as shown in the example.
The data file to be used with the form file in the following example contains 1,000
records. If you were to merge it to the document window, the resulting document would
have 1,000 pages. This merge uses PRINT to send each letter to the printer as soon as
it is merged.
ABC COMPANY
245 WEST CENTER STREET LONG BEACH CA 90807
DATE
FIELD(name)
FIELD(company)
Dear FIELD(firstname):
Thank you for your inquiry regarding our new product.
(rest of letter)
Sincerely,
Amy Wilcox
Product Manager
158
PAGEOFF PRINT
PROCESSOFF
Use PROCESSOFF to end a PROCESSON command.
For an example of PROCESSON and PROCESSOFF, see CHAINDATA(filename)
on page 134.
PROCESSON
Use PROCESSON with PROCESSOFF in a data merge file to ensure that codes are
processed even if they are not in the field or record being processed by the form file.
For an example of PROCESSON and PROCESSOFF, see CHAINDATA(filename)
on page 134.
PROMPT(message)
Use PROMPT to display a message that gives instructions to the user.
For examples of PROMPT, see ONCANCEL(action) on page 154 and
ONERROR(action) on page 155.
QUIT
Use QUIT to stop the execution of the merge. For example, while a merge is paused at
KEYBOARD, you can execute QUIT from the keyboard.
In a merge, the rest of the form file after QUIT is written out to the resulting merged
document before the merge terminates, but any commands after QUIT are not
executed. If you dont want the rest of the form file written out, use STOP instead of
QUIT.
If QUIT is used in a data file, the data file is abandoned at that point.
However, the rest of the form file is written out (but not processed) just as if the
command had been encountered in the form file. The merge then terminates.
The following example is a standard memo sent by a personnel department to all
employees before their six-month salary review. The merge ends just after the DATE
command, but the rest of the memo is written out to the resulting merged document.
MEMO
Merging documents
159
REPEATROW
Use REPEATROW when merging information into a table from a data file. The
REPEATROW command in a row inserts that row for each record in the data file.
RETURN
Use RETURN to mark the end of a subroutine and signal the merge to return from a
CALL command. RETURN must be paired with CALL, or an error message displays.
For an example of RETURN, see CALL(label) on page 130.
RETURNCANCEL
Use RETURNCANCEL to cause execution to leave the current level and return a
Cancel to the next higher level. For more information, see Levels on page 170.
In this example, RETURNCANCEL is used to return a Cancel from a status checking
subroutine.
CODES(
ONCANCEL(GO(send message))
(During this part of the merge, if the user presses Cancel,
execution is transferred to the Send Message label.)
CALL(check status)
(more merge commands)
STOP
LABEL(check status)
IF(VARIABLE(chk)=0)
160
RETURNCANCEL
ELSE
RETURN
ENDIF
)
If the chk variable equals FALSE (0), then the ONCANCEL condition is executed; if it
is TRUE, then it returns without executing the ONCANCEL condition.
RETURNERROR
Use RETURNERROR to cause execution to leave the current level and return an error
to the next higher level. For more information, see Levels on page 170.
In this example, RETURNERROR returns an error from a subroutine that nests a form
file.
CODES(
ONERROR(GO(error))
If an error is generated, execute the Error subroutine.
(more merge commands)
CALL(getfile)
(more merge commands)
STOP
LABEL(getfile)
ONERROR(RETURNERROR)
NESTFORM(invoice.frm)
RETURN
LABEL(error)
If the file was not found when the merge tried to nest it,
execution moves here.
PROMPT(File not found. Move INVOICE.FRM to default directory and start merge
again.)
Merging documents
161
REWRITE
Use REWRITE to rewrite the document window. Since none of the merged document
is written to the document window during a merge, you may want to use this command
to display what has been merged at a certain point.
In the following example, REWRITE is used to view each letter on the screen as it is
merged.
ABC COMPANY
245 WEST CENTER STREET LONG BEACH CA 90807
DATE
FIELD(name)
FIELD(company)
Dear FIELD(firstname):
Thank you for your inquiry regarding our new product.
(rest of the letter)
Sincerely,
Amy Wilcox
Product Manager
REWRITE
STATUSPROMPT(message)
Use STATUSPROMPT to display a message. The message is displayed during the
merge. The message stays in the message window until it is cleared by another
162
STEPOFF
Use STEPOFF to turn off a single step execution after it has been turned on. See also
STEPON on page 163.
STEPON
Use STEPON for debugging merges. It causes the merge to execute one step at a time.
Between each step, a message indicates what the next command is. The command
executes when the user presses any key. Each character is displayed after it is written out
to the resulting document.
You may find it useful to step through merges with Reveal Codes on.
(This section will execute normally.)
STEPON
(This section will execute one keystroke at a time.)
STEPOFF
(This section will execute normally.)
STOP
Use STOP to stop all execution. It is similar to QUIT, except that the rest of the form
file is not read in. If this command is found in a nested file, execution is not returned to
the parent file. Chained files are also not executed.
Merging documents
163
While an executing merge is paused at KEYBOARD, you can execute STOP from the
keyboard.
For an example of STOP, see IFEXISTS(var) on page 148.
STRLEN(expr)
Use STRLEN to determine the length of a variable or of the value returned by an
expression. This command is useful for validating or restricting the length of user input.
You can use FIELD, VARIABLE, text, or complex expressions in the argument expr.
For an example of STRLEN, see SUBSTR(expr;start;length) on page 166.
STRPOS(expr;subexpr)
Use STRPOS to determine the position of a subexpr within an expr.
For an example of STRPOS, see SUBSTR(expr;start;length) on page 166.
SUBSTDATA(filename)
Use SUBSTDATA to change to the named data file and start with the first record in
that file. The merge does not return to the original data file. If you substitute a file that
is not found, or no file, an error is returned. You can use ONERROR to determine what
should happen if this error occurs.
In the following example, two data files are used, each sorted by ZIP code in descending
order, so that any records where the ZIP field is blank will be at the end of the file.
SUBSTDATA causes the records with no ZIP code to be skipped, and the next data file
to be used.
CODES(
IFBLANK(ZIP)
SUBSTDATA(file2.dat)
ENDIF
)
164
SUBSTFORM(filename)
Use SUBSTFORM to change to the named form file. SUBSTFORM is similar to
NESTFORM and CHAINFORM. The difference is that the named form file is used
instead of the current form file from the point of this command on. The merge does not
return to the original form file; no commands following this one in the original form file
are executed. Local variables in a previous form file are erased.
If you substitute either a file that is not found or no file, an error is returned. You can
use ONERROR to determine what should happen if this error occurs.
In the following example, the data file has a Days Overdue field. The merge begins
using the form file invoice.frm, which substitutes a different form file depending on
the number in the Days Overdue field.
At the end of each substituted file, the record pointer is moved to the next record, and
invoice.frm is substituted, so that it will execute again.
CODES(
ASSIGN(days;FIELD(Days Overdue) DIV 30)
SWITCH(VARIABLE(days))
CASEOF(0)
SUBSTFORM(under30.frm)
CASEOF(1)
SUBSTFORM(under60.frm)
CASEOF(2)
SUBSTFORM(under90.frm)
DEFAULT
SUBSTFORM(90&over.frm)
ENDSWITCH
)
In this example, the following code would be placed at the end of each substituted form
file.
(body of file)
NEXTRECORD
Merging documents
165
SUBSTFORM(invoice.frm)
SUBSTR(expr;start;length)
Use SUBSTR to extract a portion (substring) of the expression specified in the expr
parameter. You can specify which part of the expression to use with the start and length
parameters. The start parameter counts from the left side of the expr. The length
parameter specifies how many characters are included in the substring.
For example, if a form file contains the statement SUBSTR(think;2;2), the substring
hi is inserted into the merged document. The start parameter has the value 2, so the
substring begins with the second character in the expr parameter (h.). The count
parameter has the value 2, so the substring contains two characters (h and i).
You can use FIELD, VARIABLE, text, or complex expressions in the argument expr.
In this example, the data file has a name field where the names are stored in the format
Last, First. SUBSTR extracts the first name from the name field. STRPOS is used to
find the beginning of the first name (2 characters after the start of the comma and
space). STRLEN is used to find the length of the first name (by subtracting the starting
position of the first name from the length of the full name).
CODES(
ASSIGN(start;STRPOS(FIELD(name);, )+2)
ASSIGN(length;STRLEN(FIELD(name)-VARIABLE(start)))
ASSIGN(firstname;SUBSTR(FIELD(name);VARIABLE(start);VARIABLE(length)))
VARIABLE(firstname)
)
SWITCH(expr)
Use SWITCH with CASEOF, CONTINUE, DEFAULT, and ENDSWITCH to
evaluate input and execute different functions depending on the input.
The expression in SWITCH must match the expression in CASEOF exactly. For
example, y does not match Y. If no match is found in the SWITCH statement,
execution continues after the SWITCH statement. You can use DEFAULT as the last
case in the command to handle all cases that do not match. You can use CONTINUE
to perform the commands for more than one case.
166
In the following example, SWITCH is used to include certain documents in the merge
file based on the value of the class field in a data file. If the class field does not match
any of the first three cases, DEFAULT is executed, and the file general.fil is included
in the merged document.
Because each of the other cases ends with CONTINUE, the DEFAULT case and any
cases following the one selected are executed along with the case selected. For example,
if the class field contains 2nd, then the files 2ndclass.fil, 3rdclass.fil, and general.fil
would all be included in the merged document for that record.
Dear FIELD(name):
You have chosen to travel FIELD(class) class. This allows you to enjoy the following
benefits during your trip:
CODES(
SWITCH(FIELD(class))
CASEOF(1st)
DOCUMENT(1stclass.fil)
CONTINUE
CASEOF(2nd)
DOCUMENT(2ndclass.fil)
CONTINUE
CASEOF(3rd)
DOCUMENT(3rdclass.fil)
CONTINUE
DEFAULT
DOCUMENT(general.fil)
ENDSWITCH
)
For another example of SWITCH, see FORNEXT(var;start;stop[;step]) on
page 144.
Merging documents
167
SYSTEM(sysvar)
Use SYSTEM to return the value of the given system variable. System variables allow
the merge to be aware of the current state of WordPerfect.
In the following example, the merge includes only the first three records of the form file.
When the merge reaches the fourth page of the resulting merge document, it stops.
CODES(
IF(SYSTEM(Page)=4)
STOP
ENDIF
)
(Body of the form file)
System variables are listed on the Parameter Entry dialog box when you choose the
SYSTEM command.
TOLOWER(expr)
Use TOLOWER to lowercase each character in the returned expression expr.
For an example of TOLOWER, see CAPS(expr) on page 132.
TOUPPER(expr)
Use TOUPPER to uppercase each character in the returned expression expr.
For an example of TOUPPER, see CAPS(expr) on page 132.
VARIABLE(var)
Use VARIABLE to access the contents of global and local variables. If you have a global
and a local variable with the same name, this command accesses the local variable.
There is no way to access global variables while local variables of the same name exist.
For an explanation of global and local variables, see Merge variables on page 170.
After you assign a value to a variable (using ASSIGN(var;expr) or
ASSIGNLOCAL(var;expr)), you can place the VARIABLE command anywhere you
would normally place the variable contents. You can place it as an argument for another
command, as part of an argument for another command, or by itself.
168
WAIT(10ths second)
Use WAIT to delay further execution of the merge for the indicated time. This
command is useful when you want a message to be displayed for a certain amount of
time. The wait time is specified in tenths of a second (20 = 2 seconds).
For an example of WAIT, see ONCANCEL(action) on page 154.
WHILE(expr)
Use WHILE to execute commands repeatedly. While the expression expr is true, the
commands between WHILE and ENDWHILE are repeatedly executed. This
command is like FORNEXT, except that it does not increment a value each time
through the loop. In order to end the loop, you must use BREAK or another command
that will force the expression to be evaluated as false. For more information, see Loops
on page 173.
Remember that if you use a variable in expr, the variable must already exist before the
WHILE command is executed.
For an example of WHILE, see NEXTRECORD on page 153.
ASSIGNLOCAL(var;expr)
Use ASSIGNLOCAL to assign the value returned by expr to the local variable var.
Local variables are accessible only to the current file; they are deleted when the merge
is finished or the file is exited. See also ASSIGN(var;expr) on page 128.
For an example of ASSIGNLOCAL, see CTON(character) on page 137.
Merging documents
169
Levels
In a merge document you can have as many as 40 levels of execution per file. IF
commands do not require a level; they can be nested indefinitely. Each SWITCH,
FORNEXT, or WHILE uses one level.
NESTMACRO, NESTFORM, and NESTDATA do not require an execution level,
because each nested file has 40 new execution levels.
However, they do require a nesting level. You can nest files 10 levels deep.
Merge uses separate stacks to maintain execution levels and nesting levels.
Merge variables
A variable represents a place in memory where data is stored. As its name indicates, the
data in a variable is changeable. You can use variables to calculate and keep track of text
and numeric values that change during a merge.
170
User-defined variables are variables that you create. You determine the name and
contents of these variables when you assign them. You can also perform operations on
them to change their contents. There are two subcategories of user-defined variables:
global and local.
Naming variables
Variable names can be as many as 30 characters long for both global and local variables.
Although you can use the same name for a local and a global variable, you cannot use
the same name for any two local variables or any two global variables. You should not
use the same name for a local variable and a label.
Variable names are not case sensitive. Abc, AbC, ABC, and abc are read as the same
variable.
Variables receive their names when they are assigned. For more information, see
Assigning variables on page 172.
Merging documents
171
Variable contents
All user-defined variables can contain text or numbers. A user-defined variable can hold
127 characters.
Assigning variables
You assign a global variable with ASSIGN and a local variable with ASSIGNLOCAL.
For example, the following two statements assign two different variables, one global
and one local:
ASSIGN(Number;45)
ASSIGNLOCAL(Number;36)
ASSIGN creates a global variable named Number with 45 as its contents.
ASSIGNLOCAL creates a separate, local variable named Number with 36 as its
contents. For more information, see ASSIGN(var;expr) on page 128 and
ASSIGNLOCAL(var;expr) on page 169.
In addition to using ASSIGN and ASSIGNLOCAL, the following commands also
assign variables:
CHAR
FOREACH
GETSTRING
LOOK
The following rules determine whether the variables assigned by CHAR,
GETSTRING, and LOOK are local or global in a merge:
If a local variable with the name used in the command exists, the command assigns
the value to the local variable.
If no local variable with the name used in the command exists, but a global variable
by that name does exist, the command assigns the value to the global variable.
If no variable with the name used in the command exists, a global variable of that
name is created and assigned by the command.
FOR and FOREACH assign variables by the same rules as above, except that if no
variable with the name used in the command exists (the third rule), a local variable is
created and assigned by the command. This feature allows recursion using FOR and
FOREACH in a merge.
If a variable already exists and you assign new contents to it, the previous contents will
be replaced without warning.
172
Executing variables
You can execute (write out) a variable anywhere you want its contents to appear. For
example, by executing a variable you can do the following:
Use the contents of the variable as a subroutine
Insert the contents as text in a document or in the message strings of programming
commands
Provide variable arguments in other programming commands
To execute a variable, use VARIABLE. For example, the statement
VARIABLE(Number) would execute the variable named Number.
Variable duration
Local variables exist only in the file in which they are defined. Once you quit the file
that defined the variables or once the merge ends, the local variables are erased (and the
memory assigned to them is released). However, the contents of global variables remain
in memory until you exit WordPerfect. To conserve memory, you should use local
variables instead of global variables whenever possible.
If you want to erase a variable without exiting a file or exiting WordPerfect, assign
nothing to the variable by using the following commands: ASSIGN(var;) or
ASSIGNLOCAL(var;). These commands empty the variable of its contents and release
the memory used by the variable. After you use this command, the variable no longer
exists. It is a good idea to empty variables at the beginning of the merge in which they
are used (unless the merge assigns new contents to them).
Operations on variables
All variables can be compared to each other, and user-defined variables can have other
operations performed on them. Operations are performed using various programming
commands. See Working with merge expressions on page 174 and Merge
programming commands on page 125.
Loops
Whenever the same commands repeat several times, that section of the merge is called
a loop. When you create a loop, it is very important to have a way for the loop to end.
If the loop does not have an end, there is no way to stop execution without pressing Esc
or Ctrl + Enter.
Merging documents
173
There are many types of loops you can create with merge programming commands.
You can use an IF structure or you can use FORNEXT or WHILE. You can also create
loops by going to or calling subroutines (with GO or CALL). The structure you should
use for any given loop depends on the task you are trying to accomplish.
Numeric expressions
Numeric expression values must contain only integers (or variables that contain
integers).
You can use signed numbers in expressions. The highest positive number you can use is
2,147,483,647. Numbers higher than that are considered negative in WordPerfect. For
information, see Negative numbers on page 183. The lowest negative number you
can use is 2,147,483,648.
If you try to use an invalid numeric expression, the expression is treated as a text string.
Examples of invalid numeric expressions are characters other than numbers and valid
operators or expressions that evaluate to numbers outside the numeric limits.
The following is a list of numeric expressions. In this list, the terms n1 and n2 represent
number 1 and number 2. Although only a single operator is illustrated in each example
174
below, you can use several operators as well as parentheses in expressions. For definitions
of the operations used in the following table, see Expression terms on page 180.
Expression
Operation
NOT n1
!n1
-n1
n1+n2
n1n2
n1*n2
n1/n2 or n1 DIV n2
n1%n2 or n1 MOD n2
n1 AND n2
n1 & n2
n1 OR n2
Merging documents
175
Expression
Operation
n1|n2
n1 XOR n2
n1=n2
n1!=n2 or n1<>n2
n1>n2
n1<n2
n1>=n2
n1<=n2
176
Expression evaluation
An expression must be written according to the rules and syntax in this appendix for
WordPerfect to evaluate it correctly. The following information will help you create and
use expressions.
When an expression is encountered in a command, the expression is evaluated first, and
the result of the expression is used to complete the command. For example, in the
statement ASSIGN(1;VARIABLE(1)+1), the expression is VARIABLE(1)+1.
When the expression is evaluated, the contents of variable 1 are incremented by one.
The assignment is then performed, replacing the old contents of variable 1 with the
result of the expression.
In several of the expressions, the result of the operation is either true or false.
WordPerfect assigns a numeric value to true (1) and false (0). These values were chosen
because they are opposites (numeric complements) of each other. For information, see
Bitwise NOT (!) on page 182 in Expression terms on page 180. WordPerfect
interprets any non-zero numeric value as true, but when it assigns a value for true, it
assigns 1.
In the following example, the first assignment statement assigns false (0) to variable 1,
the second assignment statement assigns true (1), the logical opposite of false, to
variable 1, and the third assignment statement assigns true (1) to variable 1.
ASSIGN(1;5=4)
ASSIGN(1;NOT VARIABLE(1))
ASSIGN(1;5!=4)
The order in which the various operators are applied in an expression is not simply the
order in which they occur. WordPerfect uses an order of precedence that determines
which operators are used first, second, and so forth. For example, in the expression
4+7*8, there is a different result depending on whether the addition is performed
before or after the multiplication. For more information about the order of evaluation,
see Operator precedence on page 177.
Operator precedence
WordPerfect supports expressions with several operators. Therefore, an order of
evaluation must be followed. The operator precedence is similar to the precedence for
mathematical operators. The following table shows the order in which operators are
applied:
Merging documents
177
String delimiters
A string delimiter is a character that marks the beginning or end of a string. In string
operations, quotation marks (") serve as string delimiters. In most cases, string
delimiters are not needed. Any expression that cannot be evaluated as a valid numeric
expression is considered a string.
However, if you want an expression to remain a string even though it could be evaluated
as a numeric expression, surround the expression with quotation marks. For example, if
you assign a phone number to a variable, but do not surround the number in quotes,
the phone number is evaluated as a numeric expression. For example, the command
ASSIGN(1;555-1555) assigns the result of subtracting 1555 from 555 (-1000) to
variable 1. The command ASSIGN(1;555-1555) assigns the string 555-1555 to
variable 1.
String expressions
A string is any sequence of one or more characters, including spaces. For example, 245,
Strawberry, QB12, Z, and Personal Computer are strings. Quotation marks are not
necessary to define strings.
The expressions outlined in the following table are used to compare strings. The terms
s1 and s2 represent string 1 and string 2.
Expression
Operation
s1=s2
s1!=s2 or s1<>s2
s1>s2
s1<s2
s1>=s2
Merging documents
179
s1<=s2
* In a string comparison, the WordPerfect character set values are compared. For
information, see WordPerfect character set values on page 184.
Expression terms
The following are technical terms used in the discussion of expressions. Understanding
these terms is not essential to performing merges. These definitions are provided for
those who are familiar with basic programming concepts.
Bitwise Operation
Bitwise AND (&)
Bitwise NOT (!)
Bitwise OR (|)
Evaluate the Expression
Exclusive OR (XOR)
Logical AND (AND)
Logical NOT (NOT)
Logical OR (OR)
Negative Numbers
WordPerfect character set values
Bitwise operation
In computer language, numbers are represented as a series of 16 bits. A bit can only
have a value of 1 or 0. Each 16-bit series (or column) represents a numeric value (such
as 1, 2, 4, 8 and so on). The following table outlines some values and their
corresponding bits.
180
Value
Bits
0000000000000000
1111111111111111
1111111111111101
21
1111111111101011
0000000000000011
0000000000000100
0000000000000111
21
0000000000010101
47
0000000000101111
A bitwise operation works on one column at a time (starting with the right column)
using a single bit from each number. The operation is done 16 times so each bit of each
number is operated on.
Bits
21
0000000000010101
47
0000000000101111
21&47
0000000000000101
Merging documents
181
Bitwise OR (|)
A bitwise OR operation compares the bits of both numbers. When either number has
a 1 bit in the same position (for example, there is a 1 bit in column 1 [the right column]
of the first number or the second number), a 1 is placed in that position in the result.
For example, the expression 21|47 is evaluated as shown in the following table:
Value
Bits
21
0000000000010101
47
0000000000101111
21|47
0000000000111111
Exclusive OR (XOR)
A logical XOR operation evaluates two expressions and returns a true (1) if one, but
not both, of the expressions is true. If both expressions are false or both are true, XOR
returns a false (0). For example, 1=1 XOR 2=3 is true (1), because only one of the
expressions being evaluated is true. 6>3 XOR 3>1 is false (0), because both
expressions are true.
Logical OR (OR)
A logical OR operation evaluates two expressions and returns a true (1) if either or
both expressions are true. If both expressions are false, it returns a false (0). For example,
1=1 OR 2=3 is true (1), because one of the expressions being evaluated is true.
6<3 OR 3<1 is false (0), because both expressions are false.
Negative numbers
In WordPerfect, negative numbers are represented as large positive numbers, from
2,147,483,648 to 4,294,967,295. The number
4,294,967,295 is 1, 4,294,967,294 is 2, and so on. To determine the number
WordPerfect uses to represent any given negative number from 1 to 2,147,483,648,
use the following formula:
4,294,967,296 |x|
where x is the negative number whose equivalent you are trying to find. For example,
to find the equivalent of 3,
4,294,967,296 3 = 4,294,967,293
To find the negative number (n) represented by a given equivalent, use this formula:
x 4,294,967,296=n
where x is the equivalent. For example, to find the negative number represented by
4,294,967,293,
4,294,967,293 4,294,967,296 = 3
You can assign variables to be negative numbers by using the minus () operator or by
using the WordPerfect equivalent. Do not use commas or other punctuation in the
equivalent. For example,
ASSIGN(number;1)
Merging documents
183
is the same as
ASSIGN(number;4294967295)
For more information about creating numeric expressions, see Numeric expressions
on page 174.
184
You can control a merge and perform specific merge functions by using the Merge
toolbar. The Merge toolbar is context-sensitive, which means that the buttons available
on the Merge toolbar change according to the task you are performing. For example,
you would see different buttons for performing a keyboard merge and for editing a data
table file.
You cannot hide the Merge toolbar for a merge form document or merge data file. If it
is not visible, then the active file is not a form document or a merge data file.
STATUSPROMPT
KEYBOARD
GETSTRING
CHAR
Merging documents
185
Command
LOOK
CALL(label)
LABEL(labelname)
RETURN
186
Nesting
Nesting a file or macro is like calling a subroutine. The merge pauses while the nested
file or macro runs, then continues after the nested file has finished. This is useful if you
use certain procedures frequently in your merges because you can save them in smaller
files.
You can have multiple levels of nesting. A merge file can nest a second file or macro,
which in turn nests another file, and so on. The three nest commands are described in
the following table.
Command
NESTDATA(filename)
NESTFORM(filename)
NESTMACRO(macroname)
Chaining
Chaining another file or macro starts that file or macro when the original merge is
finished. This is one way to run multiple merges one after the other instead of starting
each one manually. Only one chain command is used in a merge file; if there are more
than one, the last one is used. The three chain commands are described in the following
table.
Command
CHAINDATA(filename)
Merging documents
187
Command
CHAINFORM(filename)
CHAINMACRO(macroname)
Substituting
Substituting another form or data file is another way to change from one merge file to
another. However, a substitute command moves the merge immediately to the second
file without finishing the original merge file. When this happens, the new merge does
not return to the original merge. The two substitute commands are described in the
following table.
Command
SUBSTDATA(filename)
SUBSTFORM(filename)
188
Parameter
What you do
(expr);(subexpr)
(label)
(var)
(field)
(filename)
(macroname)
(title)
(prompt);(message)
(comment)
Merging documents
189
191
WordPerfect Office contains a minimal set of macros. To access more macros, visit our
OfficeCommunity site on the World Wide Web.
Using QuickMacros
WordPerfect lets you create QuickMacros. A QuickMacro is a temporary macro that
you can record without saving. WordPerfect stores a QuickMacro in your computer's
memory for the current WordPerfect session only.
192
When you record a new QuickMacro, the existing QuickMacro is replaced. You cannot
edit a QuickMacro or save it to a template.
To record a QuickMacro
1 Click Tools ` Template macro ` Record.
2 Click Record without entering a macro name in the Name box.
3 Perform the task you are recording.
4 Click Tools ` Template macro ` Record to stop recording the macro.
WordPerfect records both the keyboard and mouse actions you make;
however, you must use the keyboard instead of the mouse to position the cursor
in the document window.
To play a QuickMacro
1 Click Tools ` Template macro ` Play.
2 Click Play without entering a macro name in the Name box.
are WordPerfect commands that set one-inch left and right margins. Each command
represents one instruction or statement. The simplest macro consists of only one
statement. Complex macros have hundreds of statements. The sequence of statements
determines how a macro performs its tasks.
One way to create a macro is to record a task in WordPerfect. When you record a macro,
you convert actions into macro commands. These are stored until you need them. Use
the fewest number of steps necessary to perform your task.
193
To record a macro
1 Click Tools ` Macro ` Record.
A check mark beside the Record command indicates that the command is enabled.
2 Type a name for the macro in the Filename box.
3 Click Record.
4 Perform the actions you want to record.
A check mark beside the Pause command indicates that the command is enabled.
You can also
Pause recording a macro
194
button
5 Choose the drive and folder where you want to store the macros.
Playing macros
WordPerfect allows you to play and pause the play of macros. You can play a macro to
repeat the sequence of steps for a task you want to perform. Before you can play a
macro, however, it must be compiled with a compiler. For more information, see
Compiling macros on page 225.
To play a macro
1 Click Tools ` Macro ` Play.
2 Choose the folder where the file is stored.
3 Double-click the macro filename.
The Macro submenu displays the last nine macros you have played.
A macro you record may not play properly in every situation. Some macros
depend on certain options or settings. When a macro cannot play, a message
may display, indicating the reason and the line number(s) in the macro you can
check.
You can pause or resume playing a macro by clicking Tools ` Macro ` Pause.
You can play a macro youve used recently by clicking Tools ` Macro, and
clicking a macro displayed under the Macro command toolbar.
195
Description
abbrev.wcm
adrs2mrg.wcm
allfonts.wcm
checkbox.wcm
closeall.wcm
ctrlm.wcm
cvtdocs13.wcm
dcconvert.wcm
196
Macro
Description
endfoot.wcm
expndall.wcm
filestmp.wcm
flipenv.wcm
fontdn.wcm
fontup.wcm
footend.wcm
longname.wcm
parabrk.wcm
pleading.wcm
prompts.wcm
reverse.wcm
197
Macro
Description
saveall.wcm
savetoa.wcm
tconvert.wcm
uawp13en.wcm
wp_org.wcm
wp_pr.wcm
198
To
Stop
Record
Play
Pause
Dialog editor
Commands
Codes
Options
199
If the Template toolbar is not displayed, click View ` Toolbars, and enable
the Template check box.
If you are recording a new macro, clicking Edit ` Undo does not undo the
most recent step performed; you will still retain the step that you tried to undo.
201
If you want to use the Number of times to repeat next action value as a
default, click Use as default.
6 Click Edit.
7 Edit any macro commands.
8 Click Save & compile on the Template macro toolbar.
9 Click Options ` Close macro on the Template macro toolbar.
To display the Template macro toolbar, click Tools ` Template macro `
Template macro toolbar.
Description
POST CLOSE
POST NEW
POST OPEN
203
Trigger
Description
POST PRINT
POST STARTUP
POST TABLES
PRE CLOSE
PRE NEW
PRE OPEN
PRE PRINT
PRE TABLES
on an automated template, and the personal information has been set, this command
does nothing.
Only macros that have been added to the template can be used with triggers. A trigger
specifies when a macro plays in a template (for example, before you close a document).
Macros on disk cannot be associated with a trigger. Running the Prompt Builder
associates the POST NEW trigger with <dofiller>, the feature that runs the Prompts
dialog box. If the POST NEW trigger is associated with a template macro, use the
TemplateFill() macro command in that template macro to activate the DoFiller feature.
If you want DoFiller to run when you are using a template macro, you need to add the
TemplateFill macro command. The position of this command is important because
macro execution is generally sequential. For example, if you want to insert a macro in a
template that adds a date code to your document, you need to let the macro place the
date code prior to your filling out the template prompts.
205
206
207
208
209
To create a template menu with the same initial settings as an existing menu
1 Click File ` New from project.
2 Choose a category from the Category list box.
3 Choose a template from the Project list.
4 Click Options ` Edit WP template.
5 Click Tools ` Settings, and click Customize.
6 In the Customize settings dialog box, click the Menus tab.
7 Choose a menu from the Available menus list, and click Create.
8 In the Create menu bar dialog box, type a name for the new menu in the New
menu bar name box.
9 Click Location, and enable one of the following options:
210
211
3 In the Customize button dialog box, click Edit, and make changes in any of the
following areas:
Colors allows you to change the color of a button
Drawing mode allows you to choose between changing the image a single
pixel at a time or filling the whole area
Zoomed image allows you to re-create an image
MarginTop(MarginWidth:2.0")
Recording and playing macros can speed up routine tasks, but the real power of macros
is tapped when product commands are used together with PerfectScript programming
commands. By using product commands and programming commands, the
functionality of WordPerfect Office features is combined with the customizing, decision
making, and iterative capabilities of a programming language. Using programming
commands also makes it possible to include the functionality of other applications.
A written macro can include non-recordable statements, which cannot be included in
recorded macros, that specify how a macro performs a task. You specify conditions for
playing assignments, loops, and programming commands. Writing a macro provides
greater flexibility to determine function than recording a macro. You can create a macro
in WordPerfect and play it in the application for which it was written.
With PerfectScript, you can combine statements to automate routine tasks and simplify
large ones. You write the macro using statements, compile the macro, and play the
macro.
The PerfectScript programming language consists of WordPerfect application
commands and functions, and programming statements and functions. PerfectScript
can do more than perform your recorded WordPerfect commands it can extend the
functionality of WordPerfect in a number of ways, such as prompting you for input,
displaying messages, controlling other Corel and Windows-based applications, and
performing and repeating commands. You can also build complete applications or
wizards so that, if you have limited experience using WordPerfect, you can still use some
of the more complex actions.
PerfectScript lets you record, play, compile, and convert macros for all WordPerfect
Office applications. PerfectScript starts automatically when you record or play a macro.
If you play a macro for an application that is not running, PerfectScript automatically
starts the application.
Installing the Software Developers Kit
The Software Developers Kit (SDK) is a set of tools that lets you customize
WordPerfect Office applications for commercial or business use. For information about
acquiring a WordPerfect Office Software Developers Kit, visit Corel Technology
Partner.
The Corel Technology Partner program supports developers of complimentary products
and add-ons for selected Corel products, including WordPerfect Office X3. The
213
Description
Command name
214
Description
Parameters
Enumerations
Separators
For example:
MakeItFit (TargetPage:1;{Adjust: FitLeftMargin!};{Adjust:
FitLineSpacing!})
The command in the above example has two parameters: TargetPage and Adjust. They
are separated by a semicolon. Adjust is a repeating parameter with two enumerations
specified: FitLeftMargin and FitLineSpacing. All the Adjust parameters are enclosed in
braces to group them.
When you create macros using the macro command browser, the commands are
inserted in the correct format. If you type a macro without the macro command
browser, you must arrange macro commands and their elements in a precise order or
syntax. Each macro command must be spelled correctly and must include all the
required parameters and separators.
Using types of macro commands
There are three types of macro commands: product commands, OLE object commands,
and programming commands. Product commands are specific to a product, such as
WordPerfect or Quattro Pro. OLE object commands perform tasks on an OLE object.
Programming commands work across applications; they are PerfectScript commands.
Command names often describe an action, such as Font, MarginLeft, Advance, and
FootnoteOption, in WordPerfect; AlignObjectsLeft, BitmapBlur, SelectAllObjects, and
ToolbarCopy in Presentations; or Range in Microsoft Excel. Command names are not
Recordings, macros, and automation features
215
case sensitive and usually do not contain spaces. Exceptions include programming
commands that call a subroutine, such as Case Call or OnCancel Call.
A macro can use more than one application product and OLE object. Commands to the
non-default application or OLE object require a prefix, which is specified in an
application or object statement. For example,
A1.AboutDlg ()
A1 (followed by a period) is the prefix. It tells the compiler to use the application or
Object assigned A1 in a PerfectScript application or Object statement.
Understanding syntax
Syntax refers to the grammatical rules that govern the form of macro statements and
expressions. For example, the syntax of the following statement, which types John
Doe, is correct:
Type(Text: "John Doe")
The syntax of the next example is incorrect and produces an error message because the
statement lacks a closing parenthesis:
Type(Text: "John Doe"
If you find it difficult to distinguish different parts of a macro, remember that you can
add extra line spaces, tabs, and even font changes to make the macro more readable. As
long as the commands are written correctly, the macro compiler ignores extra spaces and
lines.
shown in mixed case. WordPerfect system variables begin with ?, such as ?TextColorRed
or ?FontUnderline. They are shown in mixed case, and they return information about
the application environment.
Line wrapping does not affect macro execution. You should not insert spaces in a
command name unless the space is part of the syntax. Do not use hard returns, tabs, or
indents in a character expression (a character string enclosed in double quotation
marks). You can use spaces, tabs, indents, and hard returns before and after commands,
or between parameters, to make a macro easier to read. SmartQuotes in a macro create
a compile-time syntax error. For more information about SmartQuotes, see Changing
the appearance of quotation marks in the online Help.
Formatting macros
You can type commands into a macro that is saved in a file or in a template. If you want
to improve the readability of a macro, you can format it so that it includes tabs, spaces,
and even font or text appearance changes. Formatting the macro does not affect how it
works. For example, WordPerfect records the following macro in this format:
PosDocBottom()
Type(Text:"Sincerely")
HardReturn()
HardReturn()
HardReturn()
HardReturn()
Type(text:"Mrs. Jane Doe")
HardReturn()
Type(Text:"Vice President, Marketing")
However, if you type the commands yourself or edit an existing macro, you can format
the macro the way you want. For example, you can format it as follows:
PosDocBottom()
Type(Text:"Sincerely")
HardReturn()
HardReturn()
HardReturn()
HardReturn()
Type(text:"Mrs. Jane Doe")
217
HardReturn()
Type(Text:"Vice President, Marketing")
5 Click Insert.
6 Click Close.
219
displays the Line height dialog box in WordPerfect if x equals the value A. If x has
another value, the subroutine displays the Line spacing dialog box. The If, Else, and
Endif commands are programming commands. LineHeightDlg and LineSpacingDlg
are product commands.
repeating macro commands or statements a specified number of times or until
certain conditions are met (for example, For, Endfor, Repeat, Until, While, or
EndWhile)
invoking or jumping to a specified subroutine with Call or Go
Programming commands and product commands are not case sensitive.
You can add blank lines to separate programming commands and subroutines, and you
can indent lines to show levels of nested commands. Some macro commands cannot be
recorded. You must type or insert them using the macro command browser. For
information about the macro command browser, see Using the macro command
browser on page 223.
Advance is the command name, Where and Amount are parameters, and
AdvanceDown! and 1.0 are parameter data. This command advances the cursor down
one inch. Parameter names, such as Where and Amount, are optional.
Data types
A data type represents information that is needed by a parameter or returned by a
command (return value).
In the command syntax, data types are displayed in italics. For example, the
enumerations for the Rotation parameter of BoxCaption Rotation are Degrees90!,
Degrees180!, Degrees270!, and None!. Only these enumerations can replace the data
type in the command syntax. Enumerations are identified by a trailing exclamation
point. The most common data types in product commands are string, enumeration, and
numeric. Programming commands frequently use variables.
220
Parameter names
Using parameter names is optional. For example, InhibitInput (State: Off!) works just
like InhibitInput (Off!). Some product commands have no parameters. Their syntax is
usually written with empty parameters, such as PosScreenUp (). Some programming
commands and all system variables have no parameters. Their syntax is the command
name alone, such as Pause and ?FeatureBar.
Italics
Italics in macros syntax indicate parameter names or types to be replaced with data. For
example, the syntax of GraphicsLineLength is:
GraphicsLineLength (Length: measurement)
After you replace measurement with a number, the command might be:
GraphicsLineLength (Length: 21)
or
GraphicsLineLength (21)
Punctuation
You must enclose parameters in parentheses. A missing parenthesis is a common error
that prevents macros from compiling. Parentheses are optional for commands without
parameters, but must be used with user-defined functions and procedures.
Spaces between command names and the opening parenthesis of the parameter section,
and after semicolons in parameters, are optional.
You must separate multiple parameters with semicolons (;). If you omit an optional
parameter, include the semicolon in the syntax to keep following parameters in their
correct positions. For example,
AbbreviationExpand (AbbreviationName:; Template: PersonalLibrary!)
or
AbbreviationExpand (; PersonalLibrary!)
Repeating parameters are enclosed in braces and are separated by semicolons. For
example,
CASE (<test>: any ; {<Case>: any; <Label>: label; <Case>: and;
<Label>: label...})
221
For example, type Assign (vName; Lori) to assign the text Lori to the variable
vName.
You can type a colon followed by the equals sign (:=) as a shortcut to assigning
a variable. For example, you could type vName:=Lori for the above example.
223
With the macro command browser, you can also insert system variables, which
contain system information, such as the current chart type or the default
directory. In WordPerfect, system variables begin with a question mark.
A parameter that is displayed in bold is a required parameter. The macro will
not compile or run without it.
The prompt text, title, and maximum parameter length are optional. You can use the
GetUnits command if you want to provide WordPerfect with measurement information
that can be used to move the cursor and set margins. If you want WordPerfect to use
the information entered in a numeric expression (such as addition or subtraction), you
can use the GetNumber command. Both the GetUnits and GetNumber commands are
similar to the GetString command; however, they do not use maximum parameter
length. The user can use any of the following abbreviations to represent units of
measurement:
Unit of measurement
Abbreviation
Millimeters
Centimeters
Inches
i or "
224
If the user doesnt type a unit of measurement with the number when prompted,
WordPerfect uses WP Units as a default unit of measurement.
Compiling macros
You must compile a macro before you can play it. The programs that compile macros
are called compilers. A macro compiler is used to compile or translate macros so that
WordPerfect Office applications can play them. WordPerfect compiles a macro every
time you save it.
Macros are written with an editor or word processor and saved as a source file. The
macro compiler creates an object, which it saves in a hidden area of the source file (the
macro compiler does not create a separate object file). When you edit the source file, the
object is destroyed. The object is recreated each time the source file is compiled. A
compiled source file (macro) contains instructions that are executed when you play the
macro.
When you compile a macro, you might receive error messages which can indicate
misspelled commands, missing parentheses or semicolons, and other syntax errors. If
you receive an error message while the macro is compiling, you must correct all the
errors before the macro will play. You can edit the macro to fix the errors.
WordPerfect macros have three types of errors: syntax errors, run-time errors, and logic
errors.
225
226
The PerfectScript application has debugging features. For more information about
PerfectScript, see the PerfectScript application online Help.
If you are writing or editing a macro, when you compile you change what is on screen
to a language that PerfectScript can play. If you want PerfectScript to be able to read
errors in the file, you must create a listing or log file. When you generate a listing file,
PerfectScript saves it with a .wcl filename extension. If you want to debug PerfectScript
macros using the PerfectScript debugger to tell you where the problems are located, you
must set PerfectScript to produce a listing file every time you save and compile the
macro. For more information about the PerfectScript debugger, see the PerfectScript
online Help.
To compile a macro
Click Save & compile on the Macro toolbar.
If the Macro toolbar is not displayed, click Tools ` Macro ` Macro toolbar.
If a macro you compile has error messages, WordPerfect still saves it even if
you do not fix the compile errors.
227
228
button.
4 Choose the drive and folder where you want to store the macro.
5 Click Select.
button.
229
To animate a macro
1 In the PerfectScript utility, click Edit ` Tools.
2 Click the Debug tab.
3 In the Animate settings area, enable one of the following options:
'Runto does step into executes the next single statement
'Runto does step over executes the call of the label or routine without
stopping until it has completed
4 Type a value in the Delay (seconds) box.
5 Click OK.
6 Click Debug ` Animate.
When correcting compilation errors, start at the beginning and first correct the
errors that are obvious, leaving the others until later, as some of these errors
may have been caused by an earlier error.
To edit a macro
1 Click Tools ` Macro ` Edit.
2 Choose the drive and folder where the macro is stored.
3 Click Edit.
230
To delete a macro
1 Click Tools ` Macro ` Edit.
2 Choose the drive and folder where the macro is stored.
3 Click a macro.
4 Press Delete.
Searching in macros
WordPerfect provides a macro with searching capabilities by recording a search in a
macro. WordPerfect lets you use all of its find and replace functionality when you are
searching in a macro. For more information about Find and Replace features, see
Finding and replacing text on page 45.
231
232
233
the class. The document object is the host application that is open. In future versions,
there will be many more objects, such as a table object or a cell object.
You can create a new object, such as a dialog box, which is known as a form. You can
add controls, such as a check box or a text box. You can set the objects properties in the
Property dialog box located in the Visual Basic Editor. You can also set the objects
properties at run time by programming a method. For example, you can color a form
red when you click on it. For more information about setting an objects properties, see
the Microsoft Visual Basic Help in the Visual Basic Editor.
An experienced programmer can work directly with the Windows API (Application
Programming Interface) and, for example, be able to determine how much disk space
is free or gain access to the systems time and date values. Most VBA users will want to
automate specific and repetitive tasks.
Accessing an application from another applications macro
You can access and change an application from another applications macro. For
example, you could create and use a Quattro Pro object from a WordPerfect VBA
macro. This allows you to change and save a Quattro Pro document from a WordPerfect
VBA macro.
Creating VBA macros
You can create two kinds of VBA macros: a global and a project macro. You can play a
global macro from more than one document; however, a project macro can be played
only in the document which was used to create it.
You can create a project VBA macro by creating a public method for the ThisDocument
object. The term public refers to the access level. If a method is public, it can be accessed
from outside the class. This means that you can call it from the host application. If a
method is private, only methods in the same class can access it. Every public method
that belongs to the ThisDocument class is a project macro. You can create a VBA macro
called ShowMessage and code one line as follows: MsgBox Hello. This VBA macro
calls a Message Box that displays the string Hello.
Using VBA macros
You can store a VBA macro in the document by saving the document. Once you have
saved the document, you can close and reopen the document and access the macro.
After you have developed the macro, you should debug it. You can step through each
macro line by line. This is a useful exercise to ensure that the macro will have the desired
234
outcome. A project macro is not available if the document is closed. After you have
debugged the macro, you can play the macro.
Assigning security
When you open WordPerfect Office documents created by other users, be aware that a
document could contain a macro virus. As a screening measure, VBA includes a security
mechanism to help manage document security. You determine the security level used
when opening or loading documents and add-ins containing embedded VBA macros.
You can review the assigned security level and collection of trusted certificates that come
from reputable sources. A VBA developer can attach his digital signature to a macro,
which creates a certificate when the document is opened. The fact that a document has
a digital signature does not automatically ensure the document to be free of viruses, so
that the onus is on you to find out if the developer scans for viruses before adding his
certificate to your trusted sources.
There are three security level settings available: High, Medium, and Low. With the
High setting, you can open a signed VBA project from a trusted source with the macros
enabled. Otherwise, the document is opened with the macros disabled. The default
security setting is Medium. A Medium setting indicates that a warning displays if you
try to load a VBA document that is not on your trusted source list. You can choose to
open the document with the macros enabled or disabled. The Low setting allows you to
open all VBA projects without applying any security (which disables all virus
protection).
235
237
238
After you have stepped into a line of code, you can point to a specific variable
to determine the value of the variable.
239
The default names of the controls are used. Located on this form are a CommandButton
and a ComboBox. You can change all of the controls attributes, including the name of
the control, in the Property dialog box located in the Visual Basic Editor.
5 Double-click on the form to access the Editor window, choose General from the
Object list box, and add the following code in the Editor window:
Dim myStyle As String
This code will create a string variable called myStyle.
6 Choose Userform from the Object list box.
7 Choose Initialize from the Procedure list box, and add the following code in the
UserForm_Initialize method:
Private Sub UserForm_Initialize()
ComboBox1.AddItem Rose
ComboBox1.AddItem World
ComboBox1.AddItem Ribbon
End Sub
This code responds to the event that occurs when the form is initialized. This code
adds three string items to the ComboBox1 control.
8 Double-click the CommandButton1 control to create a new method for the
UserForm1 class, and type the following lines of code in the
CommandButton1_Click method:
Private Sub CommandButton1_Click()
myStyle = ComboBox1
If myStyle = Then
MsgBox You have not selected a style, vbExclamation
End If
The user selected the rose watermark
If myStyle = Rose Then
PerfectScript.ClearDoc
PerfectScript.WatermarkA Create_WatermarkA_Action,
OddPages_WatermarkA_Occurrence
PerfectScript.BoxCreate 6
PerfectScript.BoxContentType Image_BoxContentType_Content
240
PerfectScript.BoxImageRetrieve MakeInternal_BoxImageRetrieve_Action,
C:\rose2.wpg
PerfectScript.ChangeWatermarkGraphicShade 25
PerfectScript.BoxUpdateDisplay
PerfectScript.BoxEnd Save_BoxEnd_State
PerfectScript.Close
End If
'The user selected the world watermark
If myStyle = World Then
PerfectScript.ClearDoc
PerfectScript.WatermarkA Create_WatermarkA_Action,
OddPages_WatermarkA_Occurrence
PerfectScript.BoxCreate 6
PerfectScript.BoxContentType Image_BoxContentType_Content
PerfectScript.BoxImageRetrieve MakeInternal_BoxImageRetrieve_Action,
C:\World3.wpg
PerfectScript.ChangeWatermarkGraphicShade 25
PerfectScript.BoxUpdateDisplay
PerfectScript.BoxEnd Save_BoxEnd_State
PerfectScript.Close
End If
'The user selected the ribbon watermark
If myStyle = Ribbon Then
PerfectScript.ClearDoc
PerfectScript.WatermarkA Create_WatermarkA_Action,
OddPages_WatermarkA_Occurrence
PerfectScript.BoxCreate 6
PerfectScript.BoxContentType Image_BoxContentType_Content
PerfectScript.BoxImageRetrieve MakeInternal_BoxImageRetrieve_Action,
C:\ribb0002.wpg
PerfectScript.ChangeWatermarkGraphicShade 25
PerfectScript.BoxUpdateDisplay
PerfectScript.BoxEnd Save_BoxEnd_State
Recordings, macros, and automation features
241
PerfectScript.Close
End If
PerfectScript.ZoomToFullPage
Unload Me
End Sub
This code responds to the event that occurs when you click the command button.
Be sure to enter the correct path to where the graphics files are located.
In this procedure, a new method called AddWatermark is added to the
ThisDocument class. This macro calls a form that lets you select a choice of
three watermarks to insert into the odd pages of the document. PerfectScript
class members can be accessed only by calling the PerfectScript object, which
must be followed by a .. You can call the AboutDlg method, which is a
PerfectScript class member, by typing PerfectScript.AboutDlg.
242
5 Type the following new code in the ShowTime method to declare two new
variables:
Public Sub ShowTime()
Dim myTime
Dim myDate As Date
End Sub
6 Type the following new code in the ShowTime method to populate the myTime
and the myDate variables:
Public Sub ShowTime()
Dim myTime
Dim myDate As Date
myTime = Time
myDate = Date
End Sub
7 Type the following new code in the ShowTime method to convert the two
variables to string data types:
Public Sub ShowTime()
Dim myTime
Dim myDate As Date
myTime = Time
myDate = Date
Dim myStrTime, myStrDate, Msg As String
myStrDate = Str(myDate)
myStrTime = Str(myTime)
End Sub
8 Type the following new code in the ShowTime method to populate and display the
Msg variable:
Public Sub ShowTime()
Dim myTime
Dim myDate As Date
myTime = Time
myDate = Date
Dim myStrTime, myStrDate, Msg As String
Recordings, macros, and automation features
243
myStrDate = Str(myDate)
myStrTime = Str(myTime)
Msg = The date is & myStrDateI & and the time is & myStrTime
MsgBox Msg
End Sub
For the purpose of this procedure, a message box was selected to display the
date and time (myDate, myTime, myStrDate, and myStrTime); however,
you can create a new form and display the time and date in this form. For more
information about VBA, see Microsoft Visual Basic Help in the Visual Basic
Editor.
245
Methods, like product commands, may require parameters, and may or may not return
values. Unlike system variables in WordPerfect, you can set properties by placing the
property name on the left-hand side of an assignment statement. Properties can also
take parameters when being retrieved or when being set. This makes the retrieval of a
property very similar to a method call.
246
247
You can use OLE Automation for long and complicated manual processes that transfer
data between two or more applications. For example, you may have a manual process
that puts data into a spreadsheet to be used to create a presentation graphic. The
graphic is used in a word processing application. If you use OLE Automation, you may
be able to create a program that automatically does these steps for you. OLE
Automation gives you almost total control over a variety of different applications,
letting you build the applications you need through its seamless integration capabilities.
At a basic level, you can think of OLE Automation as a way for applications to speak to
and control each other through their own scripting or macro programming languages.
For example, you could have WordPerfect speak to and control Microsoft Word, another
OLE Automation server. Because WordPerfect, in this case the OLE Automation
controller, is a desktop publishing application and does not know about the inner
workings of Microsoft Word, the OLE Automation server, it needs a way to get
information from the server.
Conversely, WordPerfect can be controlled by other OLE Automation applications
through its PerfectScript application commands and a programming language. Some of
the most widely used programming languages can support OLE automation, including
Microsoft Visual Basic, Microsoft Visual Basic for Applications, and C++.
WordPerfect, PerfectScript, and OLE Automation
If you have ever used a script to send commands to WordPerfect or another Corel
application, youve used OLE Automation. When you run a script that sends commands
to a Corel application, you must use the WithObject statement to enable a
programmable object in the application.
Any Corel application, including WordPerfect, that supports OLE Automation provides
one programmable object that allows the PerfectScript controller to send it commands.
The Microsoft Visual Basic GetObject command, for example, cannot be used to access
a Corel document. Additionally, Corel applications do not support properties and
methods. The only way to access a Corel document through OLE Automation is by
using PerfectScript application commands.
You can also use other scripting languages to call Corel OLE Automation applications.
For example, you can call the WordPerfect object using a script created in Visual Basic.
The following Visual Basic script creates a new WordPerfect document and inserts a
footnote.
Private Sub Form_Load()
Dim objWP As Variant
248
249
250
Service, Topic
WPWin
WPWin11_Macros,PS3Commands
Presentations
WPPresentations,Command
Quattro Pro
251
252
WordPerfect Index
A
accessing . . . . . . . . . . . . . . . . . . . . . . . 244
applications from another application . .
244
system date and time values . . . . . . 242
backing up . . . . . . . . . . . . . . . . . . . . . . . 14
documents . . . . . . . . . . . . . . . . . . . .14
alignment . . . . . . . . . . . . . . . . . . . . . . . . 41
tab . . . . . . . . . . . . . . . . . . . . . . . . . . 41
animating . . . . . . . . . . . . . . . . . . . . . . . 230
macros . . . . . . . . . . . . . . . . . . . . . . 230
annotations . . . . . . . . . . . . . . . . . . . . . . 50
adding . . . . . . . . . . . . . . . . . . . . . . . 50
incorporating . . . . . . . . . . . . . . . . . . 50
application bar . . . . . . . . . . . . . . . . . . . . . 3
arguments . . . . . . . . . . . . . . . . . . . . . . 188
merge codes . . . . . . . . . . . . . . . . . . 188
Associate button . . . . . . . . . . . . . . . . . 212
using with template macros . . . . . . 212
Associate feature . . . . . . . . . . . . . . . . . 212
associating toolbars with template features
. . . . . . . . . . . . . . . . . . . . . . . . . . . 212
using . . . . . . . . . . . . . . . . . . . . . . . 212
Index
backup . . . . . . . . . . . . . . . . . . . . . . . . . . 14
documents . . . . . . . . . . . . . . . . . . . .14
bitwise NOT . . . . . . . . . . . . . . . . . . . . 182
bitwise operation . . . . . . . . . . . . . . . . . 180
bitwise OR . . . . . . . . . . . . . . . . . . . . . . 182
bolding . . . . . . . . . . . . . . . . . . . . . . . . . . 30
text . . . . . . . . . . . . . . . . . . . . . . . . . .30
booklets . . . . . . . . . . . . . . . . . . . . . . . . . 79
printing . . . . . . . . . . . . . . . . . . . . . .79
breakpoints . . . . . . . . . . . . . . . . . . . . . .230
setting for macros . . . . . . . . . . . . . .230
buttons . . . . . . . . . . . . . . . . . . . . . . . . . 207
editing images . . . . . . . . 207, 208, 211
editing names . . . . . . . . . . . . . 207, 211
editing QuickTips . . . . . . . . . 207, 211
C
capitalization
changing . . . . . . . . . . . . . . . . . . . . .30
case
specifying in text search . . . . . . . . . . .47
centering
text . . . . . . . . . . . . . . . . . . . . . . . . . .36
chaining . . . . . . . . . . . . . . . . . . . . . . . . . 186
merge files or macros . . . . . . . . . . .186
changes
listing for document comparison . . . .55
changing . . . . . . . . . . . . . . . . . . . . . . . . 239
WordPerfect documents using Perfect-
253
WordPerfect
Script class . . . . . . . . . . . . . . . . . . 239
chapters
selecting . . . . . . . . . . . . . . . . . . . . . . 6
characters
counting . . . . . . . . . . . . . . . . . . . . . 10
precision level in document comparison
56
WordPerfect set values . . . . . . . . . . 180
Clipboard
pasting contents . . . . . . . . . . . . . . . 49
codes . . . . . . . . . . . . . . . . . . . . . . . . . . 218
endnotes . . . . . . . . . . . . . . . . . . . . . 62
footnotes . . . . . . . . . . . . . . . . . . . . . 61
inserting in macros . . . . . . . . . . . . 218
merge prompts . . . . . . . . . . . . . . . 185
columns . . . . . . . . . . . . . . . . . . . . . . . . . 25
adding to data table files . . . . . . . . 112
block protecting . . . . . . . . . . . . . . . . 25
creating and deleting . . . . . . . 25, 26, 27
deleting from data table files . . . . . 113
discontinuing . . . . . . . . . . . . . . .25, 27
navigating . . . . . . . . . . . . . . . . . . . . 27
newspaper . . . . . . . . . . . . . . . . . . . . 25
parallel . . . . . . . . . . . . . . . . . . . . . . 25
commands
macros . . . . . . . . . . . . . . . . . . . . . 214
printer . . . . . . . . . . . . . . . . . . . . . . 90
comments
printing . . . . . . . . . . . . . . . . . . .79, 80
comparing documents . . . . . . . . . . .54, 55
changing settings for . . . . . . . . . . . . 56
excluding text . . . . . . . . . . . . . . . . . 57
generating list of changes . . . . . . . . . 55
generating summary . . . . . . . . . . . . 55
including substructure text . . . . . . . . 56
removing markings . . . . . . . . . . . . . 55
specifying level of precision . . . . . . . 56
254
comparison markings
removing . . . . . . . . . . . . . . . . . . . . . 55
Compile . . . . . . . . . . . . . . . . . . . . . . . . 199
compiling . . . . . . . . . . . . . . . . . . . . . . . 225
generating listing files with PerfectScript
227
logic errors . . . . . . . . . . . . . . . . . . . 225
macros . . . . . . . . . . . . . . . . . . 225, 227
run-time errors . . . . . . . . . . . . . . . 225
syntax errors . . . . . . . . . . . . . . . . . 225
troubleshooting macro problems . . . 225
conditions . . . . . . . . . . . . . . . . . . . . . . 116
specifying for a merge . . . . . . . 116, 117
controlling
document comparisons . . . . . . . . . . 56
conversion utility . . . . . . . . . . . . . . . . . . 11
installing . . . . . . . . . . . . . . . . . . . . . 11
converting . . . . . . . . . . . . . . . . . . . . . . 110
databases to merge format . . . . . . . 110
form documents . . . . . . . . . . . . . . . 110
merge documents . . . . . . . . . . . . . . 110
multiple files . . . . . . . . . . . . . . . . . . 11
copying . . . . . . . . . . . . . . . . . . . . . . . . . 32
graphics . . . . . . . . . . . . . . . . . . . . . . 48
online text . . . . . . . . . . . . . . . . . . . . 49
text . . . . . . . . . . . . . . . . . . . . . . . . . 48
text formats . . . . . . . . . . . . . . . . . . . 32
Corel RealTime Preview
disabling . . . . . . . . . . . . . . . . . . . . . 31
previewing font changes . . . . . . . . . . 31
counting
words . . . . . . . . . . . . . . . . . . . . . . . 10
creating
VBA global macros in WordPerfect . 237
VBA macros that use PerfectScript class
239
VBA project macro in WordPerfect . 235
Index
WordPerfect
WordPerfect VBA macros to manipulate
Quattro Pro documents . . . . . . . . . 244
customizing . . . . . . . . . . . . . . . . . . . . . . 17
keyboards . . . . . . . . . . . . . . . . . . . 206
page sizes . . . . . . . . . . . . . . . . . 21, 22
Reveal Codes . . . . . . . . . . . . . . . . . . 17
cutting
graphics . . . . . . . . . . . . . . . . . . . . . . 48
text . . . . . . . . . . . . . . . . . . . . . . . . . 48
D
data files . . . . . . . . . . . . . . . . . . . . . . . . . 97
adding fields . . . . . . . . . . . . . . . . . 114
adding records . . . . . . . . . . . . . . . . 115
associating with form documents . . 105
changing default file extensions . . . 121
changing the data source . . . . . . . . 106
converting . . . . . . . . . . . . . . . . . . . 110
deleting fields . . . . . . . . . . . . . . . . 114
editing for merge . . . . . . . . . . . . . . 112
fields . . . . . . . . . . . . . . . . . . . . . . . . 97
finding records . . . . . . . . . . . . . . . . 112
ODBC . . . . . . . . . . . . . . . . . . . . . . 105
opening associated form documents 106
Quick data entry . . . . . . . . . . . . . . 112
records . . . . . . . . . . . . . . . . . . . . . . . 97
replacing field names . . . . . . . . . . . 114
retrieving from other file formats . . . 97
sorting . . . . . . . . . . . . . . . . . . . . . . 111
table . . . . . . . . . . . . . . . . . . . . . 97, 99
text . . . . . . . . . . . . . . . . . . . . . . 97, 99
viewing fields . . . . . . . . . . . . . . . . . 111
viewing records . . . . . . . . . . . . . . . 111
data sources . . . . . . . . . . . . . . 97, 100, 107
associating merge files . . . . . . . . . . 105
associating with form documents . . 105
changing . . . . . . . . . . . . . . . . . . . . 106
using address books . . . . . . . . . . . . . 97
Index
255
WordPerfect
fields from data files . . . . . . . . . . . 114
fields from data text files . . . . . . . . 114
fields from records . . . . . . . . . . . . . 113
macros . . . . . . . . . . . . . . . . . .230, 231
merge commands . . . . . . . . . .122, 123
merge records . . . . . . . . . . . . . . . . 112
page definitions . . . . . . . . . . . . . . . . 23
page sizes . . . . . . . . . . . . . . . . . . . . 23
records from data text files . . . . . . . 114
records in data files . . . . . . . . . . . . 115
rows from data tables . . . . . . . . . . . 113
navigating . . . . . . . . . . . . . . . . . . . . 15
opening . . . . . . . . . . . . . . . . . . . . . . . 4
printing . . . . . . . . . . . . . .75, 76, 78, 81
renaming . . . . . . . . . . . . . . . . . . . . . 12
restoring compared . . . . . . . . . . . . . 55
reviewing . . . . . . . . . . . . . . . . . . 50, 53
routed . . . . . . . . . . . . . . . . . . . . . . . 53
routing . . . . . . . . . . . . . . . . . . . 52, 54
saving . . . . . . . . . . . . . . . . . 12, 13, 14
saving text or graphics . . . . . . . . . . . 13
selecting . . . . . . . . . . . . . . . . . . . . . . 6
selection options . . . . . . . . . . . . . . . . 7
viewing . . . . . . . . . . . . . . . . . . . . . . 15
disabling . . . . . . . . . . . . . . . . . . . . . . . . 31
Corel RealTime Preview . . . . . . . . . 31
displaying
debug window . . . . . . . . . . . . . . . . 227
dividing . . . . . . . . . . . . . . . . . . . . . . . . . 24
pages . . . . . . . . . . . . . . . . . . . . . . . 24
documents . . . . . . . . . . . . . . . . . . . .15, 19
backing up . . . . . . . . . . . . . . . . . . . 14
comparing . . . . . . . . . . . . . . . . . . . . 54
See also comparing documents
comparing and reviewing . . . . . . . . . 55
controlling comparisons . . . . . . . . . 56
converting . . . . . . . . . . . . . . . . . . . . 11
creating . . . . . . . . . . . . . . . . . . . . . . . 3
creating a routing slip . . . . . . . . . . . 52
creating backups . . . . . . . . . . . . . . . 12
displaying the ruler . . . . . . . . . . . . . 15
double-sided . . . . . . . . . . . . . . . . . . 78
editing . . . . . . . . . . . . . . . . . . . . . . 45
formatting . . . . . . . . . . . . . . . . . . . . 19
generating comparison summary . . . 55
generating list of changes . . . . . . . . . 55
incorporating reviewers changes . . . 51
inserting files . . . . . . . . . . . . . . . . . . . 9
inserting printer commands . . . . . . . 90
merging . . . . . . . . . . . . . . . . . . . . . 97
Microsoft Word . . . . . . . . . . . . . . . . 12
256
E
editing . . . . . . . . . . . . . . . . . . . . . . . . . 230
data files . . . . . . . . . . . . . . . . . . . . 112
data text files for merge . . . . . . . . . 112
documents . . . . . . . . . . . . . . . . . . . . 45
fields in data files . . . . . . . . . . . . . . 115
macros . . . . . . . . . . . . . . . . . . . . . . 230
merge data . . . . . . . . . . . . . . . . . . . 112
merge data files . . . . . . . . . . . . . . . 112
merge fields . . . . . . . . . . . . . . . . . . 112
merge files . . . . . . . . . . . . . . . . . . . 112
merge records . . . . . . . . . . . . . . . . 112
secondary files . . . . . . . . . . . . . . . . 112
VBA macros . . . . . . . . . . . . . . . . . . 238
editing. See also reviewing
e-mailing
merged documents . . . . . . . . . 107, 109
endnotes . . . . . . . . . . . . . . . . . . . . . . . . 59
display on page . . . . . . . . . . . . . . . . 63
finding . . . . . . . . . . . . . . . . . . . . . . 61
finding codes . . . . . . . . . . . . . . . . . . 62
inserting . . . . . . . . . . . . . . . . . . . . . 60
spacing . . . . . . . . . . . . . . . . . . . . . . 63
Index
WordPerfect
envelopes . . . . . . . . . . . . . . . . . . . . . . . 107
creating . . . . . . . . . . . . . . . . . . . . . 107
merging . . . . . . . . . . . . . . . . . 107, 108
merging with address books . . . . . . 117
printing . . . . . . . . . . . . . . . . . . 82, 119
errors . . . . . . . . . . . . . . . . . . . . . . . . . . 229
testing from PerfectScript . . . . . . . . 229
excluding
text from document comparison . . . . 57
exclusive OR . . . . . . . . . . . . . . . . . . . . 182
expression terms . . . . . . . . . . . . . . . . . 180
bitwise AND . . . . . . . . . . . . . . . . . 181
bitwise NOT . . . . . . . . . . . . . . . . . 182
bitwise operation . . . . . . . . . . . . . . 180
bitwise OR . . . . . . . . . . . . . . . . . . . 182
evaluating . . . . . . . . . . . . . . . . . . . 180
exclusive OR . . . . . . . . . . . . . . . . . 182
logical AND . . . . . . . . . . . . . . . . . 182
logical NOT . . . . . . . . . . . . . . . . . 183
logical OR . . . . . . . . . . . . . . . . . . . 183
negative numbers . . . . . . . . . . . . . . 180
WordPerfect character set values . . . 180
expressions . . . . . . . . . . . . . . . . . . . . . 174
expressions (merging) . . . . . . . . . . . . . 174
evaluation of . . . . . . . . . . . . . . . . . 174
numeric . . . . . . . . . . . . . . . . . . . . . 174
string . . . . . . . . . . . . . . . . . . . . . . . 174
F
faxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
cancelling . . . . . . . . . . . . . . . . . . . . 93
pausing . . . . . . . . . . . . . . . . . . . . . . 93
sending . . . . . . . . . . . . . . . . . . . . . . 92
viewing status . . . . . . . . . . . . . . . . . 92
field codes . . . . . . . . . . . . . . . . . . . . . . 100
field names . . . . . . . . . . . . . . . . . . . . . . 112
replacing . . . . . . . . . . . . . . . . . . . . 112
Index
257
WordPerfect
size . . . . . . . . . . . . . . . . . . . . . . . . . 30
style . . . . . . . . . . . . . . . . . . . . . . . . 30
footnotes . . . . . . . . . . . . . . . . . . . . . . . .
continuing on next page . . . . . . . . .
display on page . . . . . . . . . . . . . . . .
finding . . . . . . . . . . . . . . . . . . . . . .
finding codes . . . . . . . . . . . . . . . . . .
inserting . . . . . . . . . . . . . . . . . . . . .
position . . . . . . . . . . . . . . . . . . . . . .
separator line . . . . . . . . . . . . . . . . .
spacing . . . . . . . . . . . . . . . . . . . . . .
59
63
63
61
61
59
63
64
63
G
Get Units . . . . . . . . . . . . . . . . . . . . . . . 224
GetNumber . . . . . . . . . . . . . . . . . . . . . 224
GetString . . . . . . . . . . . . . . . . . . . . . . . 224
graphics
appending . . . . . . . . . . . . . . . . . . . . 48
copying . . . . . . . . . . . . . . . . . . . . . . 48
cutting . . . . . . . . . . . . . . . . . . . . . . . 48
moving . . . . . . . . . . . . . . . . . . . . . . 49
moving to another document . . . . . . 50
moving within document . . . . . . . . . 50
pasting . . . . . . . . . . . . . . . . . . . 48, 49
graphics styles
cutting . . . . . . . . . . . . . . . . . . . . . . . 48
dithering . . . . . . . . . . . . . . . . . . 83, 84
halftone options . . . . . . . . . . . . . . . . 84
pasting . . . . . . . . . . . . . . . . . . . . . . 48
printing . . . . . . . . . . . . . . . . . . . . . . 83
saving . . . . . . . . . . . . . . . . . . . . . . . 13
H
height . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
lines . . . . . . . . . . . . . . . . . . . . . 38, 39
Help . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Help files
macro command browser . . . . . . . . 252
macros . . . . . . . . . . . . . . . . . . . . . . 251
hiding or displaying
Reveal Codes . . . . . . . . . . . . . . . . . . 16
text . . . . . . . . . . . . . . . . . . . . . . . . . 30
Yahoo! Search bar . . . . . . . . . . . . . . . 8
I
importing . . . . . . . . . . . . . . . . . . . . . . . 110
merge data . . . . . . . . . . . . . . . . . . . 110
258
Index
WordPerfect
incorporating reviewers changes . . . . . 51
indenting . . . . . . . . . . . . . . . . . . . . . . . . 35
double . . . . . . . . . . . . . . . . . . . . . . . 36
first line of paragraph . . . . . . . . . . . . 36
hanging indents . . . . . . . . . . . . . . . . 36
paragraphs . . . . . . . . . . . . . . . . . . . . 36
removing . . . . . . . . . . . . . . . . . . . . . 36
text . . . . . . . . . . . . . . . . . . . . . . 35, 36
labels . . . . . . . . . . . . . . . . . . . . . . . . . . 102
creating for a merge . . . . . . . . . . . .102
creating with address books . . . 117, 120
merging with address books . . . . . .117
printing . . . . . . . . . . . . 82, 83, 95, 117
information . . . . . . . . . . . . . . . . . . . . . 251
PerfectScript Commands . . . . . . . . 251
leading . . . . . . . . . . . . . . . . . . . . . . . . . . 38
adjusting . . . . . . . . . . . . . . . . . . . . .38
inserting . . . . . . . . . . . . . . . . . . . . . . . . . 59
files into documents . . . . . . . . . . . . . . 9
footnotes and endnotes . . . . . . . . 59, 60
line height . . . . . . . . . . . . . . . . . . . . . . . . 38
adjusting . . . . . . . . . . . . . . . . . . 38, 39
integrating . . . . . . . . . . . . . . . . . . . . . . 232
Microsoft VBA with WordPerfect . . 232
italicizing . . . . . . . . . . . . . . . . . . . . . . . . 30
text . . . . . . . . . . . . . . . . . . . . . . . . . 30
J
justifying text . . . . . . . . . . . . . . . . . . 36, 37
K
keyboard merge . . . . . . . . . . . . . 107, 108
displaying merge commands . . . . . . 124
hiding merge commands . . . . . . . . 124
skipping records . . . . . . . . . . . . . . . 108
stopping a merge . . . . . . . . . . . . . . 107
keyboards
creating . . . . . . . . . . . . . . . . . . . . . 209
customizing . . . . . . . . . . . . . . 206, 209
keystrokes . . . . . . . . . . . . . . . . . . . . . . 206
assigning macros . . . . . . . . . . . . . . 206
assigning template macros . . . . . . . 209
removing template macros . . . . . . . 209
landscape
page . . . . . . . . . . . . . . . . . . . . . . . . .72
line spacing . . . . . . . . . . . . . . . . . . . . . . . 38
adjusting . . . . . . . . . . . . . . . . . . . . .38
lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
counting . . . . . . . . . . . . . . . . . . . . . .10
height . . . . . . . . . . . . . . . . . . . . . 38, 39
spacing . . . . . . . . . . . . . . . . . . . . . . .38
listing files . . . . . . . . . . . . . . . . . . . . . . . 227
generating . . . . . . . . . . . . . . . . . . .227
logical AND . . . . . . . . . . . . . . . . . . . . . 182
logical NOT . . . . . . . . . . . . . . . . . . . . . 183
logical OR . . . . . . . . . . . . . . . . . . . . . . . 183
M
macro buttons . . . . . . . . . . . . . . . . . . . 208
editing images on . . . . . . . . . . . . . .208
Macro Command Browser . . . . . . . . . 223
getting Help . . . . . . . . . . . . . . . . . .252
inserting commands . . . . . . . . . . . .223
inserting system variables . . . . . . . .223
product commands . . . . . . . . . . . . .223
programming commands . . . . . . . .223
specifying commands . . . . . . . . . . .223
macro commands . . . . . . . . . . . . . 214, 224
accessing . . . . . . . . . . . . . . . . . . . .223
Index
259
WordPerfect
browser . . . . . . . . . . . . . . . . . . . . .
enumerations . . . . . . . . . . . . . . . .
Get Units . . . . . . . . . . . . . . . . . . .
GetNumber . . . . . . . . . . . . . . . . .
GetString . . . . . . . . . . . . . . . . . . .
MessageBox . . . . . . . . . . . . . . . . .
names . . . . . . . . . . . . . . . . . . . . . .
OLE object . . . . . . . . . . . . . . . . . .
parameters . . . . . . . . . . . . . . . . . .
product . . . . . . . . . . . . . . . . . . . . .
programming . . . . . . . . . . . . . . . .
recording into a macro . . . . . . . . . .
retrieving information . . . . . . . . . .
separators . . . . . . . . . . . . . . . . . . .
understanding . . . . . . . . . . . . . . . .
252
214
224
224
224
224
214
214
214
214
214
218
224
214
214
199
199
199
199
199
199
199
199
199
199
199
260
191
230
206
207
208
207
Index
WordPerfect
using OLE object commands . . . . . 225
using parameters . . . . . . . . . . . . . . 220
using programming commands . . . 219
using QuickMacros . . . . . . . . . . . . 192
using toolbars . . . . . . . . . . . . . . . . 198
viewing toolbars . . . . . . . . . . . 198, 199
Visual Basic for Applications . . . . . 191
WordPerfect . . . . . . . . . . . . . 191, 196
WordPerfect macros . . . . . . . . . . . . 206
writing with PerfectScript . . . . . . . . 212
Make it fit . . . . . . . . . . . . . . . . . . . . . . . . 24
using . . . . . . . . . . . . . . . . . . . . . . . . 24
manipulating . . . . . . . . . . . . . . . . . . . . . 244
applications . . . . . . . . . . . . . . . . . . 244
Quattro Pro documents . . . . . . . . . 244
margins . . . . . . . . . . . . . . . . . . . . . . . . . 19
page . . . . . . . . . . . . . . . . . . . . . . . . 19
setting . . . . . . . . . . . . . . . . . . . . 19, 20
markers . . . . . . . . . . . . . . . . . . . . . . . . 123
displaying merge commands . . 123, 124
markings
removing redline . . . . . . . . . . . . . . . 55
menus
assigning macros . . . . . . . . . . . . . . 207
assigning template macros . . . 209, 210
customizing . . . . . . . . . . . . . . 207, 210
editing current template . . . . . . . . . 210
merge code parameters . . . . . . . . . . . 188
comments . . . . . . . . . . . . . . . . . . . 188
expr . . . . . . . . . . . . . . . . . . . . . . . . 188
field . . . . . . . . . . . . . . . . . . . . . . . . 188
filename . . . . . . . . . . . . . . . . . . . . 188
labels . . . . . . . . . . . . . . . . . . . . . . . 188
macroname . . . . . . . . . . . . . . . . . . 188
message . . . . . . . . . . . . . . . . . . . . . 188
prompt . . . . . . . . . . . . . . . . . . . . . 188
subexpr . . . . . . . . . . . . . . . . . . . . . 188
Index
titles . . . . . . . . . . . . . . . . . . . . . . . .188
var . . . . . . . . . . . . . . . . . . . . . . . . .188
261
WordPerfect
QUIT . . . . . . . . . . . . . . . . . . . . . . 125
REPEATROW . . . . . . . . . . . . . . . 125
RETURN . . . . . . . . . . . . . . . .125, 186
RETURNCANCEL . . . . . . . . . . . 125
RETURNERROR . . . . . . . . . . . . . 125
REWRITE . . . . . . . . . . . . . . . . . . 125
STATUSPROMPT . . . . . . . . .125, 185
STEPOFF . . . . . . . . . . . . . . . . . . 125
STEPON . . . . . . . . . . . . . . . . . . . 125
STOP . . . . . . . . . . . . . . . . . . . . . . 125
STRLEN . . . . . . . . . . . . . . . . . . . 125
STRPOS . . . . . . . . . . . . . . . . . . . . 125
subroutines . . . . . . . . . . . . . . . . . . 186
SUBST . . . . . . . . . . . . . . . . . . . . . 125
SUBSTDATA . . . . . . . . . . . .125, 186
SUBSTFORM . . . . . . . . . . . .125, 186
SWITCH . . . . . . . . . . . . . . . . . . . 125
SYSTEM . . . . . . . . . . . . . . . . . . . 125
TOLOWER . . . . . . . . . . . . . . . . . 125
TOUPPER . . . . . . . . . . . . . . . . . . 125
using POSTNET bar commands . . 124
VARIABLE . . . . . . . . . . . . . . . . . . 125
WAIT . . . . . . . . . . . . . . . . . . . . . . 125
262
Index
WordPerfect
address book records . . . 116, 117, 118
address books . . . . . . . . . . . . . 118, 119
chaining files or macros . . . . . . . . . 186
changing default file extensions . . . 121
code parameters . . . . . . . . . . . . . . . 188
converting documents . . . . . . . . . . 110
converting merge files . . . . . . . . . . 110
creating data . . . . . . . . . . . . . . . . . . 97
creating form documents . . . . 101, 103
creating labels . . . . . . . . . . . . 100, 102
creating sideways text . . . . . . . . . . . 102
creating tables . . . . . . . . . . . . . . . . 104
data . . . . . . . . . . . . . . . . . . . . . . . . 116
data files . . . . . . . . . . . . . . . . . . . . . 97
deleting fields . . . . . . . . . . . . . . . . 112
deleting merge commands . . . . . . . 123
displaying merge commands . . . . . . 123
displaying merged fields sideways . . 100
documents . . . . . . . . .97, 107, 116, 121
e-mailing merged documents . 107, 109
envelopes . . . . . . . . .107, 108, 117, 119
expressions . . . . . . . . . . . . . . . . . . 174
form documents . . . . . . . . 97, 100, 119
hiding merge commands . . . . . . . . 122
importing data . . . . . . . . . . . . . . . . 110
including files . . . . . . . . . . . . . . . . 186
inserting merge commands . . . . . . . 123
keyboard . . . . . . . . . . . . . . . . 107, 108
labels with address books . . . . . . . . 117
levels . . . . . . . . . . . . . . . . . . . . . . . 169
loops . . . . . . . . . . . . . . . . . . . . . . . 169
merge commands . . . . . . . . . . . . . . 100
multiple files . . . . . . . . . . . . . . . . . 186
nesting files or macros . . . . . . . . . . 186
POSTNET bar commands . . 122, 124
printing merged documents . . . . . . 107
programming commands . . . . . . . . 184
records . . . . . . . . . . . . . . . . . . . . . . 116
saving merged documents . . . . . . . 107
Index
MessageBox . . . . . . . . . . . . . . . . . . . . . 224
Microsoft . . . . . . . . . . . . . . . . . . . . . . . 232
Microsoft Word
Visual Basic for Applications . . . . . .232
moving
graphics . . . . . . . . . . . . . . . . . . . 49, 50
text . . . . . . . . . . . . . . . . . . . . . . . 49, 50
N
negative numbers . . . . . . . . . . . . . . . . . 180
nesting . . . . . . . . . . . . . . . . . . . . . . . . . 186
newspaper . . . . . . . . . . . . . . . . . . . . . . . 25
columns . . . . . . . . . . . . . . . . . . . . . .25
numbering . . . . . . . . . . . . . . . . . . . . . . . 65
numbering styles
changing . . . . . . . . . . . . . . . . . . . . .66
custom . . . . . . . . . . . . . . . . . . . . . . .67
deleting . . . . . . . . . . . . . . . . . . . . . .68
font . . . . . . . . . . . . . . . . . . . . . . . . .67
inserting . . . . . . . . . . . . . . . . . . . . . .66
pages . . . . . . . . . . . . . . . 65, 66, 67, 68
secondary . . . . . . . . . . . . . . . . . . . . .66
O
ODBC . . . . . . . . . . . . . . . . . . . . . . . . . . 97
associating with form documents . . .106
263
WordPerfect
OLE Automation . . . . . . . . . . . . . .246, 247
other controllers . . . . . . . . . . . . . . 247
PerfectScript . . . . . . . . . . . . . . . . . 247
understanding . . . . . . . . . . . . . . . . 247
using . . . . . . . . . . . . . . . . . . . . . . 246
WordPerfect . . . . . . . . . . . . . . . . . 247
OLE object commands . . . . . . . . . . . . 225
using in macros . . . . . . . . . . . . . . . 225
orientation . . . . . . . . . . . . . . . . . . . . . . 20
page . . . . . . . . . . . . . . . . . . . . . . . . 72
pages . . . . . . . . . . . . . . . . . . . . .20, 21
outlining
text . . . . . . . . . . . . . . . . . . . . . . . . . 30
P
page breaks . . . . . . . . . . . . . . . . . . . . . 121
pages . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
customizing sizes . . . . . . . . . . . .21, 22
definitions . . . . . . . . . . . . . . . 20, 21, 22
dividing . . . . . . . . . . . . . . . . . . . . . 24
fitting text . . . . . . . . . . . . . . . . . . . . 24
formatting . . . . . . . . . . . . . . . . . . . . 19
margins . . . . . . . . . . . . . . . . . . .19, 20
modifying size . . . . . . . . . . . . . . . . . 23
numbering . . . . . . . . . . . 65, 66, 67, 68
orientation . . . . . . . . . . . . . . 20, 21, 72
printing sections . . . . . . . . . . . . .80, 94
restoring default . . . . . . . . . . . . . . . 24
selecting . . . . . . . . . . . . . . . . . . . . . . 6
setting margins . . . . . . . . . . . . . . . . 19
size . . . . . . . . . . . . . . . . . 20, 21, 23, 24
viewing . . . . . . . . . . . . . . . . . . . . . . 15
paper . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
orientation . . . . . . . . . . . . . . . . . . . 72
paragraphs
counting . . . . . . . . . . . . . . . . . . . . . 10
formatting . . . . . . . . . . . . . . . . . . . . 35
264
indenting . . . . . . . . . . . . . . . . . . . . . 36
selecting . . . . . . . . . . . . . . . . . . . . . . 6
spacing . . . . . . . . . . . . . . . . . . . . . . 39
parallel . . . . . . . . . . . . . . . . . . . . . . . . . . 25
parallel columns
columns . . . . . . . . . . . . . . . . . . . . . 25
parameters . . . . . . . . . . . . . . . . . 188, 220
data types . . . . . . . . . . . . . . . . . . . 220
italics . . . . . . . . . . . . . . . . . . . . . . . 220
names . . . . . . . . . . . . . . . . . . . . . . 220
punctuation . . . . . . . . . . . . . . . . . . 220
using in macros . . . . . . . . . . . . . . . 220
pasting
Clipboard contents . . . . . . . . . . . . . . 49
graphics . . . . . . . . . . . . . . . . . . . 48, 49
online text . . . . . . . . . . . . . . . . . . . . 49
text . . . . . . . . . . . . . . . . . . . . . . 48, 49
PerfectScript . . . . . . . . . . . . 212, 228, 229
PerfectScript class . . . . . . . . . . . . . . . . 239
changing WordPerfect documents . 239
PerfectScript debugger . . . . . . . . . . . . 227
viewing command meanings . . . . . 230
PerfectScript editor . . . . . . . . . . . . . . . 229
assigning variables . . . . . . . . . . . . . 222
class . . . . . . . . . . . . . . . . . . . . . . . 232
commands . . . . . . . . . . . . . . . . . . . 251
compiling macros . . . . . . . . . . . . . . 227
debugging macros . . . . . . . . . . . . . 229
editing macros . . . . . . . . . . . . . . . . 212
generating listing files . . . . . . . . . . 227
setting . . . . . . . . . . . . . . . . . . . . . . 229
setting default macro folders . . . . . . 228
setting editor . . . . . . . . . . . . . . . . . 229
starting . . . . . . . . . . . . . . . . . . . . . 228
starting from Windows Start menu . 228
testing for errors . . . . . . . . . . . . . . . 229
using variables . . . . . . . . . . . . . . . . 222
Index
WordPerfect
utility . . . . . . . . . . . . . . . . . . . . . . 228
versus VBA . . . . . . . . . . . . . . . . . . 232
writing macros . . . . . . . . . . . . . . . . 212
playing
VBA macros in WordPerfect . . . . . . 238
portrait
page . . . . . . . . . . . . . . . . . . . . . . . . 72
position . . . . . . . . . . . . . . . . . . . . . . . . . 42
tab . . . . . . . . . . . . . . . . . . . . . . . . . . 42
positioning . . . . . . . . . . . . . . . . . . . . . . . 63
footnotes . . . . . . . . . . . . . . . . . . . . . 63
POSTNET bar codes . . . . . . . . . . . . . . 124
merging a single command in form documents . . . . . . . . . . . . . . . . . . . . . . 124
previewing
fonts . . . . . . . . . . . . . . . . . . . . . . . . 31
print jobs . . . . . . . . . . . . . . . . . . 73, 74
printer commands . . . . . . . . . . . . . . . . . 91
pausing . . . . . . . . . . . . . . . . . . . . . . 91
resetting . . . . . . . . . . . . . . . . . . . . . . 91
printers . . . . . . . . . . . . . . . . . . . . . . . . . 69
adding . . . . . . . . . . . . . . . . . . . . 69, 70
adding and deleting . . . . . . . . . . . . . 69
commands . . . . . . . . . . . . . . . . . 90, 96
disabling metrics . . . . . . . . . . . . . . . 72
inserting commands . . . . . . . . . . . . . 90
properties . . . . . . . . . . . . . . . . . . . . 71
reformatting documents for . . . . . . . 71
resetting . . . . . . . . . . . . . . . . . . . . . . 91
selecting . . . . . . . . . . . . . . . . . . . . . 70
settings . . . . . . . . . . . . . .69, 88, 89, 90
specifying feed . . . . . . . . . . . . . . . . . 72
printing . . . . . . . . . . . . . . . . . . . . . 69, 107
adding printers . . . . . . . . . . . . . . 69, 70
address labels . . . . . . . . . . . . . . . . . 117
adjusting margins . . . . . . . . . . . . . . 85
advanced options . . . . . . . . . . . . . . . 87
Index
booklets . . . . . . . . . . . . . . . . . . . . . .79
cancelling . . . . . . . . . . . . . . . . . . . . .77
comments . . . . . . . . . . . . . . . . . . 79, 80
controlling print jobs . . . . . . . . . . . . .76
crop/fold marks . . . . . . . . . . . . . . . .81
data text files . . . . . . . . . . . . . . . . .114
disabling printer metrics . . . . . . . . . .72
dithering . . . . . . . . . . . . . . . . . . 83, 84
document details . . . . . . . . . . . . . . .81
documents . . . . . . . . . . . . . . . . . 75, 76
double-sided . . . . . . . . . . . . . . . . 78, 79
envelopes . . . . . . . . . . . . . . . . . . . . .82
fax . . . . . . . . . . . . . . . . . . . . . . . . . .92
graphics . . . . . . . . . . . . . . . . . . . 83, 84
inserting commands . . . . . . . . . . . . .90
labels . . . . . . . . . . . . . . . . . . 82, 83, 95
layout settings . . . . . . . . . . . . . . . . . .85
merge output . . . . . . . . . . . . . . . . .107
merged documents . . . . . . . . . . . . .107
multiple copies . . . . . . . . . . . . . . . . .75
page orientation . . . . . . . . . . . . . . . .72
pausing and resuming . . . . . . . . . 77, 93
pausing print jobs . . . . . . . . . . . . . . .91
previewing . . . . . . . . . . . . . . . . . 73, 74
printer commands . . . . . . . . . . . 90, 96
printer feed . . . . . . . . . . . . . . . . . . . .72
printer properties . . . . . . . . . . . . . . .71
printer settings . . . . . . . . . . . . . . . . .69
reformatting documents . . . . . . . . . .71
reverse order . . . . . . . . . . . . . . . . . . .72
saving settings . . . . . . . . . . . . . . . . .88
scaling print jobs . . . . . . . . . . . . . . . .85
sections . . . . . . . . . . . . . 79, 80, 93, 94
selecting printers . . . . . . . . . . . . . . . .70
setting up printers . . . . . . . . . . . . . . .91
settings . . . . . . . . . . . . . . 72, 88, 89, 90
thumbnail format . . . . . . . . . . . . . . .87
tiling print jobs . . . . . . . . . . . . . . . . .86
to files . . . . . . . . . . . . . . . . . . . . 91, 96
265
WordPerfect
viewing status . . . . . . . . . . . . . . . . . 76
removing markings . . . . . . . . . . . . . 55
removing
document comparison markings . . . . 55
property bar
assigning macros . . . . . . . . . . . . . . 208
Q
QuickFonts . . . . . . . . . . . . . . . . . . . . . . 31
reusing recent fonts . . . . . . . . . . . . . 31
QuickFormat . . . . . . . . . . . . . . . . . . . . . 32
QuickMacros . . . . . . . . . . . . . . . . . . . . 192
playing . . . . . . . . . . . . . . . . . . . . . 193
recording . . . . . . . . . . . . . . . . . . . 193
QuickTips
editing . . . . . . . . . . . . . . . . . .207, 211
R
reassigning
routed documents . . . . . . . . . . . . . . 54
recording . . . . . . . . . . . . . . . . . . . . . . . 231
searches in macros . . . . . . . . . . . . . 231
records . . . . . . . . . . . . . . . . . . . . . . . . . 97
adding to data files . . . . . . . . . . . . 115
adding to data text files . . . . . . . . . 114
deleting . . . . . . . . . . . . . . . . . . . . . 112
deleting from data files . . . . . . . . . 115
editing . . . . . . . . . . . . . . . . . . . . . 112
finding . . . . . . . . . . . . . . . . . .111, 112
inserting as labels . . . . . . . . . . . . . 120
marking for a merge . . . . . . . . . . . 116
merging . . . . . . . . . . . . . . . . . .97, 119
merging from address books . . . . . 118
setting conditions . . . . . . . . . . . . . 117
sorting . . . . . . . . . . . . . . . . . . . . . 111
viewing . . . . . . . . . . . . . . . . . . . . . 111
renaming
files . . . . . . . . . . . . . . . . . . . . . . . . . 12
replacing
text . . . . . . . . . . . . . . . . . . . . . . . . . 45
whole words . . . . . . . . . . . . . . . . . . 47
word forms . . . . . . . . . . . . . . . . . . . 47
restoring
compared documents . . . . . . . . . . . . 55
page sizes . . . . . . . . . . . . . . . . . 21, 24
Reveal Codes . . . . . . . . . . . . . . . . . . . . . 16
customizing . . . . . . . . . . . . . . . . 16, 17
endnotes . . . . . . . . . . . . . . . . . . . . . 62
footnotes . . . . . . . . . . . . . . . . . . . . . 61
hiding or displaying . . . . . . . . . . . . . 16
reviewing
changes to documents . . . . . . . . . . . 51
creating a routing slip . . . . . . . . . . . . 52
documents . . . . . . . . . . . . . . . . . 50, 55
routed documents . . . . . . . . . . . . . . 53
routing
creating a routing slip . . . . . . . . . . . . 52
documents . . . . . . . . . . . . . . . . . . . . 52
reassigning documents . . . . . . . . . . . 54
reviewing documents . . . . . . . . . . . . 53
routing slip
creating . . . . . . . . . . . . . . . . . . . . . . 52
ruler
adding tab stops . . . . . . . . . . . . . . . . 40
copying tab stops . . . . . . . . . . . . . . . 40
indenting first line . . . . . . . . . . . . . . 36
moving tab stops . . . . . . . . . . . . . . . 42
redline text
applying . . . . . . . . . . . . . . . . . . . . . 30
266
Index
WordPerfect
S
saving . . . . . . . . . . . . . . . . . . . . . . . 14, 107
compound file format . . . . . . . . . . . . 14
documents . . . . . . . . . . . . . . 12, 13, 14
graphics . . . . . . . . . . . . . . . . . . . . . . 13
merge output . . . . . . . . . . . . . . . . . 107
text . . . . . . . . . . . . . . . . . . . . . . . . . 13
SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
spreadsheets . . . . . . . . . . . . . . . . . . . . . 110
converting to data text files . . . . . . .110
strikeout . . . . . . . . . . . . . . . . . . . . . . . . . 30
text . . . . . . . . . . . . . . . . . . . . . . . . . .30
substructure text
including in document comparison . .56
searching . . . . . . . . . . . . . . . . . . . . . . . 231
in macros . . . . . . . . . . . . . . . . . . . . 231
specifying case . . . . . . . . . . . . . . . . . 47
specifying font . . . . . . . . . . . . . . . . . 46
text . . . . . . . . . . . . . . . . . . . . . . 45, 47
Web . . . . . . . . . . . . . . . . . . . . . . . 7, 8
summary
of document comparison . . . . . . . . . .55
sections . . . . . . . . . . . . . . . . . . . . . . . . . 94
printing . . . . . . . . . . . . . . . . . . . 79, 94
printing pages . . . . . . . . . . . . . . . . . 80
sentences . . . . . . . . . . . . . . . . . . . . . . . . . 6
selecting . . . . . . . . . . . . . . . . . . . . . . 6
separator line
for footnotes . . . . . . . . . . . . . . . . . . . 64
setting . . . . . . . . . . . . . . . . . . . . . . . . . 228
default macro folders in PerfectScript 228
macro breakpoints . . . . . . . . . . . . . 230
PerfectScript editor . . . . . . . . . . . . 229
shadow cursor
text . . . . . . . . . . . . . . . . . . . . . . . . . 30
size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
pages . . . . . . . . . . . . . . . .20, 21, 23, 24
Software Developer Kit (SDK) . . . . . . 212
sorting . . . . . . . . . . . . . . . . . . . . . . . . . 111
data files . . . . . . . . . . . . . . . . . . . . 111
records in data files . . . . . . . . . . . . 111
spacing
between lines . . . . . . . . . . . . . . . . . . 38
between paragraphs . . . . . . . . . . . . . 39
Index
syntax . . . . . . . . . . . . . . . . . . . . . . . . . . 214
system date . . . . . . . . . . . . . . . . . . . . . 242
accessing values . . . . . . . . . . . . . . .242
T
tables . . . . . . . . . . . . . . . . . . . . . . . . . . 104
tables of contents
converting to data text files . . . . . . .110
creating for a merge . . . . . . . . . . . .104
tabs
adding . . . . . . . . . . . . . . . . . . . . 39, 40
alignment . . . . . . . . . . . . . . . . . . . . .41
copying . . . . . . . . . . . . . . . . . . . . . .40
decimal alignment . . . . . . . . . . . . . .41
moving . . . . . . . . . . . . . . . . . . . . . . .42
removing . . . . . . . . . . . . . . . . . . 42, 43
restoring settings . . . . . . . . . . . . . 42, 43
snap to ruler . . . . . . . . . . . . . . . . . . .42
267
WordPerfect
template macros . . . . . . . . . . . . . . . . . 200
adding . . . . . . . . . . . . . . . . . .200, 202
adding from scratch . . . . . . . . . . . . 201
assigning to keystrokes . . . . . . . . . . 209
assigning to menus . . . . . . . . .209, 210
assigning to toolbars . . . . . . . . . . . 209
assigning to toollbar buttons . . . . . 211
creating keyboards . . . . . . . . . . . . . 209
creating menus . . . . . . . . . . . . . . . 210
deleting . . . . . . . . . . . . . . . . . .202, 203
editing . . . . . . . . . . . . . . . . . . . . . 202
pause recording . . . . . . . . . . . . . . . 201
pausing . . . . . . . . . . . . . . . . . . . . . 201
playing . . . . . . . . . . . . . . . . . . . . . 201
recording . . . . . . . . . . . . . . . . . . . 201
repeating . . . . . . . . . . . . . . . . . . . . 201
resuming . . . . . . . . . . . . . . . . . . . . 201
saving and compiling . . . . . . . . . . . 202
using the Associate button . . . . . . . 212
viewing saved . . . . . . . . . . . . . . . . 201
TemplateFill macro command . . . . . . 203
adding . . . . . . . . . . . . . . . . . . . . . 205
templates
triggering macros . . . . . . . . . . . . . 203
testing . . . . . . . . . . . . . . . . . . . . . . . . . 229
errors from PerfectScript . . . . . . . . 229
text . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
appending to Clipboard . . . . . . . . . . 48
copying . . . . . . . . . . . . . . . . . . . .48, 49
cutting . . . . . . . . . . . . . . . . . . . . . . 48
excluding from document comparison 57
finding and replacing . . . . . . . . . . . 45
moving . . . . . . . . . . . . . . . . . . . . . . 49
moving to another document . . . . . . 50
moving within document . . . . . . . . . 50
pasting . . . . . . . . . . . . . . . . . . . . . . 49
substructure . . . . . . . . . . . . . . . . . . 56
268
Index
triggers . . . . . . . . . . . . . . . . . . . . . . . . . 203
DoFiller . . . . . . . . . . . . . . . . . . . . 203
macro . . . . . . . . . . . . . . . . . . . . . . 203
typesetting
leading . . . . . . . . . . . . . . . . . . . . . . 38
U
underlining . . . . . . . . . . . . . . . . . . . . . . . 30
V
values . . . . . . . . . . . . . . . . . . . . . . . . . . 242
accessing system date . . . . . . . . . . . 242
accessing system time . . . . . . . . . . . 242
variables . . . . . . . . . . . . . . . . . . . . . . . . 222
assigning in PerfectScript . . . . . . . . 222
using in PerfectScript . . . . . . . . . . . 222
VBA . . . . . . . . . . . . . . . . . . . . . . . 232, 242
VBA macros . . . . . . . . . . . . . . . . . . . . . 239
assigning security . . . . . . . . . . . . . . 232
creating macros . . . . . . . . . . . . . . . 232
debugging macros . . . . . . . . . . . . . 238
displaying toolbars . . . . . . . . . . . . . 235
editing macros . . . . . . . . . . . . . . . . 238
editor . . . . . . . . . . . . . . . . . . . . . . . 232
event driven programming . . . . . . . 232
global macros . . . . . . . . . . . . . . . . . 237
methods . . . . . . . . . . . . . . . . . . . . . 242
PerfectScript class . . . . . . . . . . . . . 239
playing in WordPerfect . . . . . . . . . 238
project macros . . . . . . . . . . . . . . . . 235
starting from WordPerfect . . . . . . . 235
using macros . . . . . . . . . . . . . . . . . 232
views . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
switching . . . . . . . . . . . . . . . . . . . . . 15
volumes
selecting . . . . . . . . . . . . . . . . . . . . . . 6
W
Web
searching . . . . . . . . . . . . . . . . . . . .7, 8
Web browser
copying and pasting text from . . . . . 49
word count . . . . . . . . . . . . . . . . . . . . . . 10
WordPerfect macros . . . . . . . . . . . . . 206
previous versions . . . . . . . . . . . . . . 219
updating from previous versions . . . 219
words
counting . . . . . . . . . . . . . . . . . . . . . 10
finding and replacing . . . . . . . . . . . 47
in document comparison . . . . . . . . . 56
selecting . . . . . . . . . . . . . . . . . . . . . . 6
work area
exploring . . . . . . . . . . . . . . . . . . . . . . 2
Y
Yahoo! Search . . . . . . . . . . . . . . . . . . . .7, 8
Yahoo! Search bar
hiding or displaying . . . . . . . . . . . . . . 8
performing Web search . . . . . . . . . . . 8
270