Home | Tips | Library | Other Authors | Other WP Sites | Writer's Links | Contact | Site Map | Donate

Barry MacDonnell's
Toolbox for WordPerfect

Macros, tips, and templates for Corel® WordPerfect® for Windows®
© Copyright 1996-2023 by Barry MacDonnell. All Rights Reserved.

Page updated Jan 15, 2023

WordPerfect Tips
Main tips page | Browse more tips

Filling in forms using WordPerfect

Pages related to "forms" -

How to quickly fill up label or business card sheets with duplicates 

Merge tips 

Boilerplate - How to insert 'boilerplate' and/or other repeating items with QuickWords, QuickCorrect, Quick macros, regular macros, custom templates, styles, text variables, etc.

Page Contents - Filling in forms using WordPerfect

■ Filling in forms originally created in a WordPerfect Document to be printed on blank paper (or label sheets), using a

A. Borderless table
B. Prompted template
C. Macro
D. Keyboard merge
E. Single-border text box
F. Text variables (WordPerfect 10 and later)

Filling in pre-printed forms, using a

A. Scanner (i.e., using a scanned copy of the pre-printed form as a watermark in a WordPerfect document and a borderless table "overlay" to position the data on it)
B. FormFill macro (i.e., using a WordPerfect macro to position the data in a Wordperfect on-screen document, with the pre-printed form(s) inserted in the printer tray)

Filling in forms originally created with Adobe Acrobat (pdf) or similar programs

Filling in forms originally created in a WordPerfect document

A. Use a borderless table to set up the data locations 

Basically this refers to WordPerfect document that contains one or more borderless tables (discussed below) to hold your variable data. You can also create a custom template to produce this document whenever needed.

In turn, a "borderless" table is one with all table border lines and cell lines turned off.

Note: These lines are not the same things as non-printing table gridlines or table guidelines, as explained here. When visible on screen, those non-printing lines will help guide you to the cells that are to be filled in.

You can, of course use some — or all — borders and cell lines in the table, if your table form calls for them to be visible and print.

Tip: See Using WordPerfect Tables for many tips about tables, using them as a formatting tool, using them as a mini-spreadsheet, etc.


Creating a borderless table is easily done: 

Either -

(1) Right-click in the table and choose Borders/Fill.
(2) Click the Table tab in t
he Properties for Table Border/Fill dialog that appears.
(3) In the Default Cell Lines section, click the Line button to open the choices palette.
(4) Click "X" to select No Line ["X" = off].
(5) Click OK.

or -

(1) Place the cursor in a table cell.
(2) Select the entire table with the Select All Cells button (image) on the table's property bar.
(3) Click the Default Line Style button (image) which then appears on the property bar, and choose the "X" option from the list that appears ["X" = off].
(4) Click outside the table to de-select it.


☼  Note that the methods here deal with Cell lines. Some tables might also have a separate Table border line around the perimeter of the table. This can be removed from the Table tab in the Properties for Table Border/Fill dialog. (Right click on the table and choose Border/Fill, then click the Table tab in that dialog.)

☼  To remove (clear) any existing user-set Cell lines from the table, which can take precedence over program default settings and thus might remain even after using either of the above methods -

(1) Select the cells that have the cell lines you want to remove. The quick and easy ways:

- To select just a single affected cell: Move the mouse cursor to near the top line in that cell until the cursor turns into a single upward pointing arrow symbol, then click the mouse.

- To select a section of the table: Place the cursor inside the top left cell in the block of affected cells, then navigate to the bottom right cell in that block;  hold down the Shift key while you click the mouse in that second cell.

- To select the entire table: Place the cursor inside the first cell of the table, then navigate to the end cell in the table; hold down the Shift key while you click the mouse in that last cell.

At this point all selected cells should have a black (i.e., reversed) background — cell border to cell border to indicate the cell structure is included.

(2) Right-click on the now-selected cell(s) and choose Border/Fill.

(3) On the Cell tab in the Properties for Table Border/Fill dialog that appears:

- To remove all lines from the selected cells, in the Cell lines section set all six cell line option boxes to "X" ["X" = off].

- To remove just specific lines (e.g., Left or Right) set their specific option boxes to "X".

(4) Click OK, and then click outside the selection to de-select it.

Using the form

To add information in the table while it is on screen:

You can use a borderless multi-cell table with fixed text (or empty "spacer" areas) in locked cells (to lock and unlock cells, see here) in the main document window of the template. Then fill in the variable data in the unlocked cells, load your paper or label stock, and print. 

Note: No watermark image of an actual form is needed, but of course you could use one so the fixed text (or other items on the form) shows up on the same page, layered underneath the table. See, for example, the scanner method below.

The descriptive headings or other fixed information on the form are simply placed inside locked cells; the user then uses the <Tab> (or <Shift><Tab>) key to go to areas where the form's text is needed. [To create locked cells, and unlock them if needed, see the method here.]

Underline cells (optional)

To assist users with adding information in the printed table:

You can add a visible "underline" underneath any cell: Simply toggle that cell's bottom cell line "on" by right-clicking the cell and selecting Borders/Fill; under the Cell tab, set the cell's bottom line to a suitable line style. Naturally, all other cell borders typically are set "off" unless you require them for stylistic reasons. (See Footnote 4 for more details.) (Also see Method E, below, which explains how to use single-border text boxes to produce "underlines.")


☼  For more, see Laura Acklen's Creating Forms with Tables (a Corel Tutorial for WordPerfect 12, but the information should apply to more recent versions). It covers removing/adding lines, joining/splitting cells, adding underlines [for more details on such underlines see also Footnote 4 below], locking cells, and rotating cell contents.

☼  For more table tips see here.

☼  Consider making a custom template (.WPT) from the table document. This helps protect the form from accidental changes.

☼  For an example or a borderless table used to create a landscape form that can rotate text on Avery (or similar) labels, cards, tags, etc., see here.


As Jim Shackleford said on his Creating Forms web page [unfortunately no longer available]:

"While table based forms can admittedly be more difficult to set up than non-table forms, tables have several advantages:

  • Users can simply tab through the fields much like a data entry form for a database.
  • If desired, one can obtain and manipulate the data entered into the cells [e.g., via a merge] or even export a table for importation into a database or spreadsheet.
  • [For "underlines" using cell lines/borders:] Unlike graphic lines, table and cell lines will print pretty much the same from printer to printer.
  • [For "underlines" using cell lines/borders:] Text does not "move" when inputting data in a "fill in the blank" form on the PC, unlike lines created by repeatedly pressing the underscore character on the keyboard."
  • [Additional benefit:] Unlike graphic lines, the underline (bottom cell line) will move downward if the cell has multiple lines of text or if more rows are inserted above it. In other words, then remain in the same relative location to the text inside the cell.

Related items

  • Splitting cells to customize or equalize the size of certain cells (shows how to split table cells in a particular row so that the resulting cells are equal in width, which sometimes doesn't seem possible in a multi-column table with various column widths)
  • Variable cell widths - How to create some table cells in a table form that have variable widths without changing cells that appear directly above and below that row. [The trick lies in using multiple adjacent ("stacked") one-row tables.]
  • Instead of manually tabbing through cells to insert data you can use (for example) the prompted templatemacro, or keyboard merge method descrbed below to automate the process of inserting data at appropriate locations in the form.
  • WordPerfect tables have several uses beyond the ones discussed above. See "Using WordPerfect tables" for some "How To" methods and tips.

Page Top

B. Use a prompted template to fill in a form document


A WordPerfect custom template that contains bookmarks at specific locations where your variable data is to be inserted.


This method uses special WordPerfect bookmarks at specific locations. Using prompted templates is discussed in detail in "Automating WordPerfect Templates," a PDF file that you can read or download on the Tips page under the section, Automating templates (and which is also found inside the author's LetterHd file in the Library).

For some forms this is a bit more elegant than other methods since the user sees a dialog window when the document opens, containing all the "fields" that correspond to areas on the form itself. (In recent WordPerfect versions you can have up to 64 fill-in fields.)

Some drawbacks: 

  • While the information that you enter in any particular field in the prompt dialog can be used to insert data in several document locations (a "one-input-to-many-locations" operation), you cannot use "pull-down" or "drop list" menus to choose from among several names or other items ("many-to-one") in the prompt dialog. However, a macro (next method below) can do this.
  • The prompted data is not restricted to a defined section of the document the way using a cell in a borderless table can restrict it (if the table row's properties is set up that way). The inserted data will push subsequent text downward. While this may not be an issue for you, you should be aware of it before designing and creating the prompted template. (You can, of course, use a borderless table in the prompted template to contain/restrict the prompted material to a given location. But a lot of extra information can be "hidden" in the table cell, so be sure to test this method.)

Page Top

C. Use a macro to fill in a form document 


One or more custom macros to input data at various locations in a "form" document, plus one or more such documents that contain special bookmarks the macro can use to locate data input areas (or custom templates that can spawn such documents).

Note: Creating a macro with a pop-up dialog to receive, and then use, data input requires knowing how to write macros with the appropriate code. However, even relatively new users might want to explore the simple macros in the Footnotes below.


Here, the macro's dialog(s) collects the information you need and then inserts it into appropriate (pre-defined) locations in the document.

This is similar to the prompted template method (a "one-input-to-many-locations" operation) but it can be more flexible.

For example, the macro can be a standalone macro to use on any document that has specific bookmarks in it, or it can be a template macro triggered to play when a "form document" based on that template is opened.


  • An example is shown in Footnote 2, which uses a macro to find and select paired bookmarks and their text placeholders, replacing the placeholders with the desired data.
  • Another, simpler example is shown in Footnote 3. It uses a macro (but without an "input" dialog) to find and select text "fields" (i.e., text placeholders) that were previously typed into the document (e.g., [NAME], [ADDR], etc.).

Page Top

D. Use a keyboard merge

If you plan to fill in the WordPerfect "form document" in one sitting, you can set up the form as a "merge form" with "keyboard stops".

Unlike many typical merge operations, this method uses your keyboard as the "source" of the data. That is to say, you simply type relevant text into a small dialog, and when the Alt+Enter key combination is pressed (or the Continue button is clicked), WordPerfect inserts that data into a predefined location. Then the program goes to the next location, etc.

Note that you can also combine a merge operation with a keyboard merge, as discussed below.


A WordPerfect "form document" that contains special "stop" codes at specific locations where your variable data is to be inserted (or custom templates that can spawn such documents).


This is a one-input-to-one-location (then repeat at the next location) type of operation. It is similar to the macro examples mentioned in section 1C above. However, a keyboard merge is a built-in program feature, and it can also prompt the user at each location on the form document.

If you need to enter the same information in multiple locations, consider using an automated prompted template or text variables (text variables were introduced in WordPerfect 10).


[The following applies to WordPerfect 12 and later versions, but the process is very similar in earlier versions.]

Creating the form document

Step 1. To set up your form for a keyboard merge, open your form document and on the WordPerfect menu use Tools, Merge (to open the Merge dialog).

Then click the Form Document button and choose "Create Form Document" as shown in this image:

Keyboard merge dialog

In the Data File Source dialog that appears choose "Use file in active window" then click OK:

Keyboard merge dialog #2

In the Associate Form and Data dialog that appears choose "No association" and then click OK:

Keyboard merge dialog #3

You'll now have a Merge Toolbar at the top of the document:

Merge bar

Note: If there's a Merge dialog on screen (see example above) click Cancel on that dialog to dismiss it.

Related tip:

You can (optionally) combine a normal merge of data from a data source with a keyboard merge (see the Merge Tips page for some merge resources if you are not familiar with "data sources"):

First, decide on the data file, address book, etc. (the "data source") that you want to associate with the form you are using for the Keyboard Merge.

In the form file, use the Merge Toolbar (shown in the image above) and click the Go to Data button to locate and choose the data file/source you want to use.

Next, add normal merge fields (via the Insert Field button) and text in the form document that will be filled from your data source by WordPerfect during the keyboard merge (in Step 5 below).

When finished inserting normal merge fields and any text, add various "stop here" keyboard merge codes as explained in Step 2 below.

[For more information on merges and keyboard merges see the User Guide included with WordPerfect (available via the Help menu by clicking Reference Center > User Guide. Then look for "Performing merges" in the Guide.]

Step 2. Insert "stop here" keyboard merge codes.

Position your cursor in the document where you want to insert information and click the Insert Merge Code button (on the Merge Bar), then choose Keyboard.

Enter some text to prompt you (or the user). It can be a short phrase or several short sentences (maximum = 127 characters).

For example, type "Enter the client's name:" and click OK.

You will see a merge command appear in the document at the cursor location that looks like this:

KEYBOARD(Enter the client's name:)

Repeat step 2, using the Insert Merge Code > Keyboard buttons to insert KEYBOARD() codes at other locations in the form where you need information to be filled in by the user.

Note: You can force the screen display to show only the local text area, and not dozens or hundreds of following characters. This helps you visually locate the area in the document you are entering data into. See the Help (F1) Index tab, "Merge commands" or "Merge codes" for the DISPLAYSTOP code, which provides this option. It can be inserted anywhere in the document, multiple times, with the Insert Merge Code button's "More..." option. Typically it is placed after a line or two of text following a KEYBOARD() command so as to display the local text area.

Step 3. Save the document. Note that it will be given a .FRM filename extension. (When you open it later, the Merge Bar will be visible, ready for you to perform the keyboard merge.)

Using the form document

To produce a filled-in copy of the form, you will do a keyboard merge — that is, you'll merge the data you input on your keyboard to the on screen form, ultimately creating a copy of the form (now filled in) in a separate document.


You can use a small template macro with a form document set up as a keyboard merge template to load a new document based on that template and then (1) display a message to the user; (2) run the keyboard merge; and (3) display a reminder after the merge is run. See the Footnote 1 below.

Step 4. Open the .FRM document if it is not already open. Click on Merge on the Merge Bar to bring up the Merge dialog. The Form document should be set to "Current Document," the Data Source to "None," and the Output to "New Document."

Step 5. Click on Merge in the Merge dialog. The cursor will move to the first location and a message box will appear with the user's prompt (instructions to the user about what to type, etc.). At that point the cursor should be where it is supposed to be in the document; just type the information appropriate to that location, and move to the next location.

Pressing <Alt+Enter> or clicking the Continue button on the Merge Bar will move you from one keyboard stop (i.e., document location) to the next. If you don't need to enter anything at a particular keyboard stop, click the Continue button or the Skip Next Record button on the Merge Bar, or just press <Alt+Enter>.


You can assign the Continue function to a keyboard shortcut:
1. Go to menu "Tools"->"Settings"->"Customize"
2. Select the "Keyboards" tab
3. Select the keyboard layout already in use, and click "Edit"
4. Click in the "Choose a shortcut key" list and press F10
5. Select "Tools" in the 'Feature categories' dropdown
6. Select the "End Field" feature and click 'Assign Feature to Key'
7. Click OK, Close, Close.

[— From a report on OfficeCommunity.com (thanks to Steve Wise, who got it from Pascal, a Corel employee)]

Step 6. When you have finished entering data (or if you click on Stop or Quit) the cursor will move to end of the new document, which will be a copy of the original with data filled in — but without the merge codes. Save the document.

Notes and Tips

  • Save as you work. You can save the document anytime during a keyboard merge. Since the Output is of the merge is being sent to the new document currently on screen (not the form document you created in Step 3), the first time you save it you will be asked to give the document a name: Note that WordPerfect automatically assigns a .WPD filename extension. Continue with the merge, saving as often as you like.
  • Stop vs. Quit. If you click Stop during the keyboard merge, any remaining text in the merge form will not appear in the new document. Also, if you click Quit, the new document will contain remaining merge codes as well as all text. It probably is better to use Stop to abort the merge, since this should prevent confusing the original merge form (with all its merge codes) with the new, unfinished document.
  • Revisions. If you need to revise your input data, either go back to the original document and Merge from the keyboard again (creating a new filled-in document), or simply edit the filled-in document at the locations that need to be changed. The latter is preferable, of course, but it depends on how easy it is to find the filled-in locations on the form.

Page Top

E. Use single border text boxes


A WordPerfect document that contains several text boxes at locations where your variable text is to be inserted (or custom templates that can spawn such documents).

Description and Method

This method appears complex, but is really very easy to do. It requires that you create new, "floating underlines" with single-border text boxes that are attached to various paragraphs, instead of using underscores (which can be "pushed" aside when data is entered) or some other method of creating underlines (such as graphic lines, which may fail to move if the form is edited).

Here's how:

Put the cursor in the paragraph containing the fill-in field. Click on Insert, Text Box. When the new box appears (it will have hatched borders), click anywhere outside it. Then right-click on it to select the box (eight small drag handles should appear around the perimeter of the box). In the context menu that appears at the same time, choose "Wrap," choose "Behind text," then click OK. This allows the fill-in text to appear on top of the box, rather than wrap around it.

The box should still be selected (if not, right-click on it and choose "Select Box"). Right-click on the selected box to bring up the context menu again and choose "Position." Be sure to set the position to "Paragraph" so it will move with the paragraph (i.e., with any text ending with a hard return [HRt]). Click OK.

The box should still be selected, so right-click on it again and choose "Border/Fill." Under the Border tab, in "Available border styles," left-click on the icon with a single bottom border ("Thin bottom" style), then click OK. You now have a rough underline tool.

Finally, with the box still selected, move your cursor over it until it turns to a four-headed arrow, then hold down the left mouse button and drag the box into position on the page where it is to serve as an underline, then release the mouse button. (Notice that a thumb-tack appears during the move to let you know which paragraph the box will be attached to.) You can move the mouse cursor over the right (or left) edge of the box until it turns to a two-headed arrow, then left-click-and-drag the vertical edge to horizontally size the box to your needs.

Now, when you type on the same line as the box, the words you type will appear over the box, which provides the underlined "field."

To make more boxes for your form, just pass the cursor over an existing box, and right-click to select it. Press <Ctrl+C> to copy the selected box to the Windows clipboard. Move to another paragraph if desired. Use <Ctrl+V> to paste the copy into the document (if you haven't moved to another paragraph, it will appear directly on top of the original), right-click on it, then left-click-and-drag the copy into the new position. Repeat to make as many copies as needed, adjusting the width of each box according to the new location's underline requirements.


If you print the form on another printer (including faxing it), or print using another version of WP or Windows, the location of the text boxes may shift. See here for some printer problem solutions.

Page Top

Filling in pre-printed forms

A. Scanner method: Store the form as a watermark in a WordPerfect document

If you frequently use a particular form — and the form is not on special (or required) paper, or it's not copyrighted — you can use a scanner to scan the form as a page-size graphic image into WordPerfect and insert it into a watermark.

Then you can use a borderless table in the main document area as a sort of "overlay" on top of the watermark, with all table cells locked wherever you don't want to enter text.

The user then needs only to <Tab> to the next unlocked "field" and enter text on the form.

Step 1.  Create a custom template

The best way to do this is to create a new custom template so that users are less likely to modify the original.

Click on File, New from Project (or New in WP8), Options button, Create WP Template.

Then create the watermark with Insert, Watermark.

You can scan the form into the watermark window (Insert, Graphics, Acquire Image) or, if the file is on disk, use Insert, Graphics, From File.

After the form is inside the watermark, set the watermark shading to 100% with the button on the property bar, then close the watermark window (File, Close, or click the right-hand button on the property bar) to return to the main template window.

Test print the template document to see if the form prints similarly to the pre-printed form; if not, adjust the size or position of the form's image in the watermark.

Step 2.  Create a borderless table with one or more locked cells

Next, create a borderless table as an overlay in the main document window, with all table cells locked except those that the user must <Tab> to, to enter information.

Tip: You could use a copy of your paper form to draw the table in pencil, then create the table in WordPerfect to match it.

Use Table, Create (or Format, Table in early versions of WordPerfect) and create the table with enough cells to "cover" the form. Drag row and column borders, join cells, split cells, etc., as needed. Then right-click the table and select Border/Fill, then select the Table tab. Set the table default cell lines to <None> and click Apply or OK.

To lock table cells, place your cursor in the cell (or select the range of cells) to be locked with your mouse, then right-click on the cell(s) and choose Format from the menu. This brings up the Properties for Table Format dialog. Under the Cell tab, check the box "Lock cell to prevent changes," then click Apply or OK. Repeat his procedure to lock all cells that should be locked.

Be attentive while you do this. If you lock the wrong cells — or even the entire table — you can unlock them with the methods described here.

Finally, go to the Row tab to set row height (a fixed height may work best), row margins, etc. Don't forget to set a font type and size for the table. Save the template. When a new document is opened based on this template it can be filled out and printed.

The advantage of this method is that it saves you from using a pre-printed form each time you print, since you can use ordinary printer paper. This also is a better method if you tend to run out of pre-printed forms: the "forms" are now on your computer. And because of this, you can save the completed form to a convenient folder rather than having to make a physical copy as you would with a pre-printed form. The main disadvantages are in the up-front time it takes to set the form up as a template, and the fact that watermarks are limited to one page, requiring separate scanned images for each page.

Notes and Tips

  • Even though you can create a multipage watermark, WordPerfect will only display the first page of a watermark in the main document window. This makes sense, because watermarks are designed to display on every page of a document, so only the first page of a watermark will show. This small problem can be overcome by using sequential one-page watermarks:
    • Create the first one and close the watermark window. Then enter a hard page break (with <Ctrl+Enter>) in the main document window to create a new page, then create the same watermark (A or B) on the top of that next page with the next page of your form embedded in it. Then exit the watermark window, enter another hard page break, create the next watermark, etc. — repeating as needed. Each new watermark supercedes the previous one. You can, of course, alternate Watermark A with Watermark B, but you will need to discontinue the last watermark used on the next page to prevent these two flavors of watermark from interfering with each other.
  • It is possible that some text or merged data could push one or more [Watermark] codes downward, causing a problem with the display of the proper watermark images. For a method that solves this problem by hiding the [Watermark] (and other) codes inside the document's initial style code, see this thread on WordPerfect Universe.

Alternatives to this watermark-plus-table overlay method include

(1) scanning the image as above, but using either prompts (or a macro) to fill in the form by locating bookmarks (created with Tools, Bookmark) set at specific locations in the main overlay document, or

(2) using a macro to get information and then position the cursor on the overlay document with Format, Typesetting, Advance, or

(3) using the manual method of using the Shadow Cursor (see View, Shadow Cursor) to move to the desired locations on the overlay document to insert material in the main document.

Using prompted templates is discussed in great detail in "Automating WordPerfect Templates.PDF," which is also found inside the LetterHd archive (.zip) file in the Library. For short forms this may be more elegant, since the user sees a dialog window on screen containing all the fields used on the form itself.

Note that using the Shadow Cursor means that WordPerfect will use hard returns and tabs for page positioning, and the method doesn't restrict text to a given location the way a table cell would. However, it may be useful for your own personal forms where user training or correcting text spillover aren't important issues.

Other methods for filling in scanned forms include using third-party software with form-fill capabilities, such as ScanSoft's PaperPort, Foxit Reader, or PDF-Xchange. The last two are (free) replacements for Adobe PDF Reader.

Page Top

B. FormFill macro method: Print directly on pre-printed forms loaded in the printer tray

Download Ron Hirsch's FormFill macro on the Toolbox's Other Authors page.

You first take measurements from your pre-printed (single-page) form and tell the macro where to place text (it'll remember these locations).

Then load the pre-printed form in the printer tray, and the macro will print the text directly on the form as it passes through the printer.

This method may require a small amount of explanation to new users who wish to set up several new forms, but it has the advantage of not requiring complex table formatting — you need only take a ruler to your paper form, jot down some measurements, and input them into the macro when asked. The macro then creates a document on disk (the new "form") that is used later by the same macro to fill in information it gets from the user.

Its main disadvantage it that it works only with single-page forms.

Page Top

Filling in forms originally created with Adobe Acrobat (i.e., "PDF" documents)

A. Using WordPerfect

Here are some tips from the public Corel WP9 newsgroup:

(tbritches) "... Open the form in Adobe Reader. Use the graphics select tool and select the entire form. In WordPerfect, choose Insert|watermark. Paste the graphic. Make sure shading is set to 100%. Then you can fill the form in WP. You might have to play with vertical advance or the position of the graphic to get things to line up properly." [Ed.- Also see the tips above (under Preprinted Forms) about using a table or a form-fill macro.]

B. Using another program

You may be able to type directly on these PDF forms with Foxit Reader or PDF-Xchange. The last two programs are (free) replacements for Adobe PDF Reader, and include a "typewriter mode" as well as some other mark up tools.

Tip: If the PDF will not let you type on it because of the security settings the originator of the form set up, but you can print the form, you could (1) view that PDF in your default PDF viewer (e.g., Adobe Reader, Foxit, etc.), then (2) print that PDF to a new PDF (instead of to a physical printer) using a low-cost or free PDF editor program. The resulting second generation PDF should let you fill in the form using Foxit Reader, PDF-Xchange, or similar.

Page Top

Footnote 1

[...Continued from above...]

Keyboard merges (see above): You can include the following template macro inside a keyboard merge form set up as a template, associated with the POST NEW trigger. Then, when you click File, New from Project, and select the template, a new form document will be loaded and then it will (1) display a message to the user; (2) run the keyboard merge; and (3) display a reminder after the merge is run.

For more information about automating templates with template macros, see "Automating WordPerfect Templates," which includes instructions on inserting macro code (such as shown below) into templates, associating them with triggers, using a separate "loader" macro that can instantly display the template document, etc.

// Macro code begins -
// KBmerge.wcm - Use this as a Template Macro ONLY

// vHRt inserts a hard return in the Messageboxes -

"When you press OK, you will be able to fill in"+vHRt+
"this form document. Messages will appear at the"+vHRt+
"bottom of the screen to help you with each item."+vHRt+vHRt+
"You can move to the next item with <Alt+Enter>"+vHRt+
"or with the Continue button on the new Merge bar"+vHRt+
"that will appear."+vHRt+vHRt+
"Be sure to print the form when you are finished.";
If(vAns=2) // (if Cancel)

// Store the form document's number -

// Run the merge, output to a new document -
MergeRun (
FormFileType: Current!;
DataFileType: NoData!;
OutputFileType: ToNewDoc!)

// Store the merged document number -
// Switch to the form doc and close it -
// Switch back to the merged doc -

"Be sure to proof-read the document"+vHRt+
"before printing it.")


Page Top

Footnote 2

[...Continued from above...]

Here is a small macro that first finds (and stores in an array) every paired bookmark in the document, then it selects each text placeholder found between the paired [Bookmark] codes and replaces the placeholder with whatever you type into a small pop-up dialog. It repeats until all paired bookmarks have been processed.

To copy the code below into your WordPerfect program, see here.

Important: All bookmarks must be paired bookmarks, not single-code bookmarks. This is usually done by selecting the placeholder text first, then creating the bookmark (enabling the checkbox choice, "Selected Bookmark"). If there are any single-code bookmarks, the macro will simply exit when if comes to one of them. Therefore, be sure to check the Bookmarks dialog (Tools, Bookmark) for existing Bookmarks before adding your own paired Bookmarks.

Here's how it works. Suppose your document has this paired bookmark and text placeholder (shown here in bold):


The macro will stop at the bookmark, highlight the "NAME" placeholder, and replace the placeholder's text with whatever you desire.

You do not need text placeholders (just the paired bookmarks), but this makes it slightly less confusing than not having placeholders since the user can see the placeholder on screen, highlighted and in context.


☼  During processing the document, if you want to delete a text placeholder and not replace it with anything, simply do not enter anything in the small pop-up dialog. Just press <Enter> to move to the next paired bookmark and placeholder.

☼  You can use the name of the bookmark, not the name of the placeholder, in the pop-up dialog. In the code below, in the GetString() command, replace "ArrayT[x]" with Array[x]". In that case, the text placeholders would not be needed unless you also want visual cues in the document itself (i.e., the placeholders — if any — are normally highlighted by the code below).


The GetData() is an obsolete command, but it still works (at least in WPX3). If you get an error the first time the macro is played or edited, simply continue with compiling the macro.

// Macro code begins -
// Adapted from a post by Kenneth Hobson here:
// http://www.wpuniverse.com/vb/showthread.php?postid=26106#post26106

// delete any QuickMark (single-code Bookmark):
BookmarkDelete ("QuickMark")

// find out how many bookmarks exist:
GetData(vBooknum; Bookmark!; Count!; CurrentDoc!)

IF(vBooknum>0) // make sure there are some bookmarks

Declare Array[vBooknum]
Declare ArrayT[vBooknum]
FORNEXT(x; 1; vBooknum)
     GetData(vBookname; Bookmark!; Name!; CurrentDoc!; x) // get name.
     Array[x]=vBookname //Assign bookmark narmes to an array.
     GetString(Indirect("Var"+x); "Replace: "+ArrayT[x]+NToC(0F90Ah)+NToC(0F90Ah)+"with: ";"Fill in form")

    "Cannot find any Bookmarks in this document!")


Page Top

Footnote 3

[...Continued from above...]

Here is a simple "looping" macro that finds several text "fields" — strings of ordinary characters (e.g., [NAME], [ADDR], [TEL]), like the text placeholders in the macro in Footnote 2 above — that you have previously typed into a document, and then pauses to let you type relevant information at that location (or you can just press <Delete> to remove the field from the document). Then you simply press <Enter> to continue to the next item. When all items are found, a "Finished" message pops up and the macro terminates.

To copy the code below into your WordPerfect program, see here.


You should use text strings (e.g., [NAME]) that are not used for other purposes. Create unique field names such as [**NAME**] or create short field names that tell the user to do something, such as [ENTER NAME HERE]. Then use these text strings in the ForEach command below.


☼  You can use the same text field name in more than one location in the document, including headers, footers, footnotes, endnotes and text boxes. The macro will process multiple identical field names, one at a time, before it goes on to a different field name.

☼  Instead of using Pausekey(Enter!), you can use the GetString() and/or GetNumber() PerfectScript commands, along with Type() commands to insert the material into the document. This approach was used in a macro posted on WordPerfect Universe here. (The GetNumber() commands were used to add two user-input numbers before inserting the total.)

// Macro code begins -
pExitSubstructures () // (exit from any header, footer, footnote, text box, etc.)
MatchSelection // (when found, select the item)
// Note the last item is NOT followed by a semicolon:
ForEach (i; {"[NAME]"; "[ADDR]"; "[TEL]"})
         PauseKey(Enter!) // (user should enter text & press <Enter> to continue)
         pExitSubstructures ()

Procedure pExitSubstructures ()
    If(vSubDoc=10 or vSubDoc=11) BoxEnd(Save!) EndIf
// If the cursor is in an image or a text box is selected, exit from it:
If(vBoxType=1 or vBoxType=3) BoxEnd(Save!) Endif

Footnote 4

[...Continued from above...]

Adding “underlines” to table cells to indicate a fill-in cell, using built-in cell lines

Step 1. [Optional:] First decide if you want a narrow horizontal gap between the cells in each table row. This allows breaking up the “underline” between cells in the rows, rather than having a continuous (bottom) line across all columns. (Such adjacent cells can always be selected and joined (Table, Join...) horizontally to create a continuous underline.)

If you don’t need such gaps between adjacent horizontal cells. skip down to step 2.

If you do need them you can simply create narrow, empty columns between each data coumn to serve as horizontal “gaps” between the cells in each row.

Here’s how:

Step 1a.
Click inside any cell where there should be a gap on the right side of all cells in that column. Then right click in that column and choose Insert, Columns (1), Placement (After), OK. This adds a new, empty column to the right of the current column. Then -

Right click in that new column and choose Format...; this opens the Properties for Table Format dialog. Then -

Under the Column tab, adjust the column width (e.g., 0.1") and also set both inside margins to 0.0". Click OK.

Step 1b.
Repeat Step 1a for other columns where a gap between them is desired.

Step 2. “Underline” the desired cells by using table cell lines on just the bottom of the cells.

Important: The following method assumes all cell lines for the desired cells are already turned “off”. [See the methods to do this in Section A above.] Otherwise, the desired underlined locations might not be obvious to the user as indicating where data is to be typed or written.

Related tip about dotted gray gridlines and guidelines in tables: There can be an interaction between table gridlines, table guidelines, and table cell lines/borders/backgrounds. Some of these settings can prevent cell lines/boders/backgrounds from being visible on screen, even though they print. [See here for more.]

Step 2a.
First select the cells that should have a “line” underneath (i.e., on the bottom of) each cell.


Be sure to select the entire cell structure, not just the cell contents. If the cell structure is selected the cell(s) will have a black background from border to border. If just the cell contents are selected the cell(s) will not be "completely filled in" with the black background.

The easy way to do this for an individual cell is to position the mouse cursor close to the top border of the cell and when the cursor turns to an upward pinting arrow, left click on that cell.

To select multiple contiguous cells (i.e., a “block” of cells) just place the cursor inside the beginning cell of that block, then navigate to the ending cell of that block and hold down the Shift key while you click in that cell.

Step 2a.
Right-click in the selected cell(s). Choose Borders/Fill from the context menu that appears. This brings up the “Properties for Table Borders/Fill” dialog.

Step 2b.
Under the Cell tab in that dialog, in the Cell Lines section, first make sure all choices are marked with an “X”. Then click in the choice for Bottom and change it to (e.g.) Single Line. (On the right side of that dialog you will see a graphic representation of the results for the cell(s).)

Step 2c.
Repeat step 2a and step 2b for any remaining cells that require visible bottom lines.

Step 3. Click OK to return to the document.

Page Top