Chapter 10

LETTERS, MEMOS, AND
BOILERPLATE CORRESPONDENCE

Correspondence forms the backbone of computer word processing. Everyone has letters to write, and most people agree that using a word processor makes the task a little more palatable. With so much emphasis on preparing correspondence, it makes sense to take advantage of WordPerfect's advanced features of macros and merges. With just a few hours of preparation, you can build a system of WordPerfect letter and memo formats that do just about everything but the actual writing.

This chapter presents a collection of business letters and memos, and how to prepare them using more efficiently and professionally by using macros, styles, and merge templates.

 

LETTERS

The first thing you probably learned on WordPerfect was how to write a letter. Instead of formatting and starting each letter from scratch, you can prepare a macro that automatically inserts the codes you regularly use in your business correspondence. For example, it is customary to format business letters without right justification and without page numbers, and many people prefer to center the body of the letter between the top and bottom margins. These formats may not be the ones you use for your other documents, so you'll need to provide some means to quickly change the document defaults.

LETFORM.WPM formats a new document to the following settings. Feel free to change the formats as you wish.


LETFORM.WPM

Key Sequence What it Does
1. [Ctrl]-[F10] Starts macro definition.
2. letform
[Enter]
Names macro.
3. Standard letter format Describes macro.
4. [Shift]-[F8] Selects Format menu.
5. L Chooses Line option menu.
6. J L [Enter] Selects left justification.
7. S 1 [Enter] Selects single spacing.
8. W Y [Enter] Turns widow/orphan protection on.
9. [Enter] P Exits Line option menu and selects Page option menu.
10. N P 9 Turns page numbering off.
11. [Exit] Leaves Format menu.
12. [Shift]-[F7] Selects Print menu.
13. T H [Enter] Selects high quality print option, exit Print menu.
14. [Ctrl]-[F10] Ends macro definition.

Run this macro whenever you want to start a new letter using these formats. If one or more of the formats are already defaults, it won't make any difference. WordPerfect will automatically insert a {DISPLAY OFF} code at the beginning of the macro so the actual execution of the macro won't be seen.


Storing the Formats As a Style

If you don't care to have all those format codes at the beginning of your letter documents, define a style (call it LETFORM) following the same steps outlined above, but without defining a macro. Next, save the style, using the Save option in Style menu, as "LETFORM.STY." When you want to use the style in a new document,

Key Sequence What it Does
1. [Alt]-[F8] Chooses Style menu.
2. R letform.sty Retrieves the LETFORM.STY style document (containing only the "LETFORM" style).
3. O Turns the style on and returns you to the editing window.

You can reduce the number of keystrokes required to call the style by defining a macro. Both the LETFORM.STY and STYLFORM.WPM files are provided on the Applications Disk.

STYLFORM.WPM (provided on the Applications Disk)

Key Sequence What it Does
1. [Ctrl]-[F10] Starts macro definition.
2. stylform
[Enter]
Names macro.
3. Calls letform.sty Describes macro.
4. [Alt]-[F8] Chooses Style menu.
5. R letform.sty Retrieves the LETFORM.STY[Enter] Ofile, turns the LETFORM style on, and returns you to the editing window.

If you have stored more than one style in the LETFORM.STY file, all of the styles are retrieved and placed in the Style menu. You can indicate the one you want with the name search option in the Style menu. Press N, type the name of the style you want to use, press [Enter], and strike O (letter O, not zero) to turn the style on.


Blocked Letter Styles

Three of the most popular letter styles are blocked, semi-blocked, and full-blocked. The full-blocked letter style is a snap to format because all of the lines start at the left margin, including the date and complimentary close. Paragraphs are not indented, but they do have an extra space between each one. The LETFORM style or macro described in the last two sections are perfectly suited for preparing full-blocked letters.

The blocked (also called modified blocked) letter style places the date and complimentary close at the approximate center of the page between the left and right margins. This format is less formal, and if you've set up the tab stops ahead of time, is really no trouble to write.

The semi-blocked letter style is similar to the blocked letter style except that the paragraphs are indented five to 12 spaces. This requires an additional tab stop for the paragraph indention.


Letter Format Chooser

All three popular letter formats are provided in LETTERS.WPM. Start this macro and select a letter format to use. The current date (as set by DOS) is automatically added to the letter for you. The three letter formats share the same basic formatting: left justified, single spaced, widow/orphan on, and no page numbering. In addition, the blocked letter format uses only one relative tab stop at 3.5 inches. The semi-blocked letter format provides relative tab stops at 0.8 and 3.5 inches.


LETTERS.WPM (provided on the Applications Disk)

1.  {DISPLAY OFF}
    {CHAR}type~{^\}Choose a letter format: {^]}1 B{^\}locked 
      {^]}2 S{^\}emi-blocked  
      {^]}3 F{^\}ull-blocked~
2.  {CASE}{VARIABLE}type~~
      1~block~ B~block~ b~block~
      2~semi~  S~semi~  s~semi~
      3~full~  F~full~  f~full~
      ~
    {QUIT}
3.  {LABEL}block~
    {CALL}standard~
    {Format}LT
    {Del to EOL}
    3.5{Enter}
    {Exit}{Exit}
    {Tab}{Date/Outline}T
    {Enter}{Enter}{Enter}
    {QUIT}
4.  {LABEL}semi~
    {CALL}standard~{Format}LT
    {Del to EOL}
    0.8{Enter}3.5{Enter}
    {Exit}{Exit}
    {Tab}{Tab}{Date/Outline}T
    {Enter}{Enter}{Enter}
    {QUIT}
5.  {LABEL}full~
    {CALL}standard~
    {Date/Outline}T
    {Enter}{Enter}{Enter}
    {QUIT}
6.  {LABEL}standard~
    {Format}L
    JL
    S1{Enter}
    WY{Enter}
    P
    NPN{Enter}
    CY{Exit}
    {Print}TH{Enter}
    {RETURN}

 

Adding an Integrated Letterhead

If you don't have pre-printed letterhead, or don't want to pass the letterhead through your printer, you can have Wordperfect add the letterhead to the first page of every letter. Your letterhead can be text only, a combination of text and graphics, or all graphics. The letterhead is stored in the header of the document, which is turned on for the first page only.

Although you can build the letterhead for each document using just a macro, a more efficient approach is to use a ready-made template along with a supporting macro. The macro retrieves the letterhead template, immediately asks you to give it a new name (so that you don't accidentally erase the original), and drops the cursor at the spot for the first line of text.

First, construct the letterhead so that the letterhead itself is placed in the A header. The example uses centered and bold text surrounded by a box frame (made with Line Draw), but you can create your own letterhead using any technique you desire.

If you have a laser printer that supports downloadable fonts, or has fonts built-in, select a large, easy to read font for the company name and address. You may also wish to use a logo or other graphic with the letterhead. WordPerfect's graphics feature lets you pull graphics files previously saved on the disk and insert them into frames within the document. Graphics look particularly good when produced on a laser printer.

Exit the header and decrease the top margin to 0.5". This pushes the letterhead further up the page, allowing you more space in the body of the document. You may also include other formatting codes that you regularly use for your letters, including left and right margin settings, tab settings, and so forth. Add one or two empty lines so that the cursor stops a little below the header. Save the document as LETHEAD.TMP; you can use another descriptive name of your choice, but be sure to indicate the new name in the macro.

The macro retrieves the document, then immediately resaves it. A {TEXT} prompt asks for a new name. Type it in and press [Enter]. The macro then moves the cursor to the end of the document, in preparation for writing.


LETHEAD.WPM (provided on the Applications Disk)

1.  {Retrieve}LETHEAD.TMP{Enter}
2.  {TEXT}name~Save file as...(include drive andsubdirectory, if       
 necessary)  ~ 
3.  {Save}{VARIABLE}name~{Enter}
4.  {Home}{Home}{Down}

Write the body of the letter as usual. When you are finished, save it again (press [F10], then answer Y to the prompt that appears), and you are ready print the letter.


Automatically Inserting the Date

Even if your business letters are all different, some things never change: you still need to include the date and a complimentary close. These can be readily inserted using macros.

If your computer maintains the current date, or you regularly re-enter the date whenever you turn the machine on, you can use WordPerfect's date stamp feature to automatically provide the date for you. Provided below are three date-stamping macros. You may wish to rename the macro you use so you can invoke it with an [Alt]-letter combination, such as [Alt]-D (rename the macro ALTD.WPM).


DATER1.WPM (provided on the Applications Disk)

{DISPLAY OFF}
{Date/Outline}T


DATER2.WPM (provided on the Applications Disk)

{DISPLAY OFF}
{Date/Outline}F
%2/%1/5{Enter}
T{Setup}ID
{Enter}{Exit}


DATER3.WPM (provided on the Applications Disk)

1.  {ON CANCEL}{GO}cancel~~
2.  {CHAR}type~{^\}Insert date {^]}C{^\}ode or {^]}T{^\}ext?  ~
3.  {IF}"{VARIABLE}type~"="c"|"{VARIABLE}type~"="C"|
      "{VARIABLE}type~"="t"|"{VARIABLE}type~"="T"~
    {ELSE}
      {QUIT}
    {END IF}
4.  {DISPLAY OFF}
    {Date/Outline}F
5.  {CHAR}key~{Del to EOP}
    {^]}Enter a date format:{^\}{Enter}
    {^]}A{^\}     January 1, 1999{Enter}
    {^]}B{^\}     1 January, 1999{Enter}
    {^]}C{^\}     January 1{Enter}
    {^]}D{^\}     1 January{Enter}
    {^]}E{^\}     Jan 1, 1999{Enter}
    {^]}F{^\}     1 Jan, 1999{Enter}
    {^]}G{^\}     Jan 1{Enter}
    {^]}H{^\}     1 Jan{Enter}{Enter}
    {^]}I{^\}     01/01/1999{Enter}
    {^]}J{^\}     01/01/99{Enter}
    {^]}K{^\}     01/01/99 (Monday){Enter}{Enter}
    {^]}L{^\}     1/1/1999{Enter}
    {^]}M{^\}     1/1/99{Enter}
    {^]}N{^\}     1/1/99 (Mon){Enter}{Enter}
    Or press Cancel to quit  ~
6.  {CASE}{VARIABLE}key~~
      A~A~  a~A~
      B~B~  b~B~
      C~C~  c~C~
      D~D~  d~D~
      E~E~  e~E~
      F~F~  f~F~
      G~G~  g~G~
      H~H~  h~H~
      I~I~  i~I~
      J~J~  j~J~
      K~K~  k~K~
      L~L~  l~L~
      M~M~  m~M~
      N~N~  n~N~
      ~
    {DISPLAY ON}
    {Exit}{Exit}
    {QUIT}
7.  {LABEL}A~
      3 1, 4{GO}xit~
    {LABEL}B~
      1 3, 4{GO}xit~
    {LABEL}C~
      3 1{GO}xit~
    {LABEL}D~
      1 3{GO}xit~
    {LABEL}E~
      %3 1, 4{GO}xit~
    {LABEL}F~
      1 %3, 4{GO}xit~
    {LABEL}G~
      %3 1{GO}xit~
    {LABEL}H~
      1 %3{GO}xit~
    {LABEL}I~
      %2/%1/4{GO}xit~
    {LABEL}J~
      %2/%1/5{GO}xit~
    {LABEL}K~
      %2/%1/5 (6){GO}xit~
    {LABEL}L~
      $2/$1/4{GO}xit~
    {LABEL}M~
      $2/$1/5{GO}xit~
    {LABEL}N~
      $2/$1/5 ($6){GO}xit~
8.  {LABEL}xit~{Exit}
    {VARIABLE}type~
    {Setup}ID
    {Enter}{Exit}
    {Screen}{Screen}
    {QUIT}
9.  {LABEL}cancel~
    {DISPLAY ON}
    {WHILE}{SYSTEM}menu~!=65535~
      {Exit}
    {END WHILE}

Automatically Inserting the Complimentary Close

The complimentary close for your letters may be simple, such as

Sincerely,
John Doe


or elaborate:

Yours Very Truly,

ANDERSON, PIKE AND ROOSEVELT
Milton Thomas Roosevelt, Esq.MTR/jrg 

In either case, you can commit the closing of the letter to a macro. Define the macro in the use way, name it [Alt]-C, and enter the close exactly as you want it to appear at the end of the letter. If you are using a semi-blocked or blocked letter style, add tabs to express the lines to the center of the page. If you make a mistake, start over or edit the macro later.

 

MEMOS

Imagine a world without interoffice memos. Although a lot of people would look forward to such a paradise, memos are a fact of business. Macros can make your memo writing more pleasant, or at least speed up the process to minimize the agony.


Basic Memo

You can write a basic macro that types out "INTEROFFICE MEMO" at the top, then pauses while you enter the date, the subject of the memo, who you are, and who you are writing it to.


MEMO.WPM (provided on the Applications Disk)

1.  {Center}{Bold}INTEROFFICE MEMO{Bold}{Enter}{Enter}
2.  DATE:  {PAUSE}{Enter}{Enter}
    SUBJECT:  {PAUSE}{Enter}{Enter}
    FROM:  {PAUSE}{Enter}{Enter}
    TO:  {PAUSE}{Enter}{Enter}

 

Reply Memo

You can have WordPerfect automatically format the memo with reply boxes for use by the recipient. The following macro performs the same basic steps as MEMO.WPM, but also pauses to allow you to indicate -- by pressing the Exit key -- when you are done writing the memo text. After that, the macro adds the reply check boxes and associated text.


REPMEMO.WPM (provided on the Applications Disk)

1.  {CANCEL OFF}
2.  {Center}{Bold}INTEROFFICE MEMO{Bold}{Enter}{Enter}
    DATE:  {PAUSE}{Enter}{Enter}
    SUBJECT:  {PAUSE}{Enter}{Enter}
    FROM:  {PAUSE}{Enter}{Enter}
    TO:  {PAUSE}{Enter}{Enter}
3.  {STATUS PROMPT}Write memo, press Exit when done  ~
    {PAUSE KEY}{Exit}~
4.  {Enter}{Enter}{Enter}
    {DISPLAY OFF}
5.  {Graphics}LH{Exit}
    {Enter}{Enter}
    {Graphics}UO
B   SSSS{Enter}
6.  {CALL}do_box~
       Please respond   
    {CALL}do_box~
       Please call   
    {CALL}do_box~
       FYI
    {STATUS PROMPT}~
    {QUIT}
7.  {LABEL}do_box~
    {Graphics}UC
    TC
    VA
    SB
    .2{Enter}
    .2{Enter}
    WN{Exit}
    {RETURN}

ABOUT BOILERPLATE CORRESPONDENCE

Dear Mr. Scott:

Thank you for ordering Desmonds' Gourmet Chocolate Covered Snails. We have processed your order and are ready to rush it to you, but as we use United Parcel Service two-day delivery, we need a street address before we can ship...

The bulk of work of most anyone who uses a word processor is repetitive tasks such this form letter reply. You may have to prepare dozens of letters like these every day, and do it all between your other regular duties. You can prepare such boilerplate correspondence using either merge or macros.

 

BOILERPLATE MERGE ENTRY TEMPLATES

Most people associate WordPerfect's merge function as a way to prepare mailing lists. That's limited thinking. In fact, merges have a greater utility than most people give them credit. You can create quick and easy merge documents that not only tell you exactly what kind of information is required, but prints the document when you are done.

When used to prepare boilerplate text (for letters, reports, proposals, and so forth, the merge documents are templates. A template is a pattern that you use to prepare regular correspondence, invoices, customer reply letters, and other documents where the main body of the text remains the same; only the names are changed to direct each document to its rightful owner. The design of the template is such that the basic formatting and information is already there. You quickly fill in the blanks and print out the document.

The typical merge operation consists of two documents, a primary file and secondary file.

While the secondary file is useful in preparing regular statements to customers or maintaining a mailing list, it isn't strictly needed when working with boilerplate templates. WordPerfect can merge data you type from the keyboard directly into the primary file. An added benefit of using merge to prepare forms documents is that the primary (original) file is never touched. WordPerfect automatically creates copies and places the information you enter into the copy.

Auto-merge templates use just a few of WordPerfect's merge codes, especially {INPUT}, {PROMPT}, and {KEYBOARD}. A full list of merge codes appears in Chapter 8, "Merging With WordPerfect.

Each instruction is displayed at the bottom of the screen during merging, but is not included in the final document. This technique of using prompts and messages was also detailed in Chapter 9, "Creating Menu Systems."

To build the template, write it as usual but enter the merge codes from the keyboard. Chapter 8 explains how to enter merge codes, but here's a short recap:

  1. Press [Shift]-[F9] twice. A pop-up window appears.
  2. Type the first few characters of the code you want to use.
  3. With the highlight bar over the code you want, press [Enter].

Many of WordPerfect's merge codes require arguments. For example, the {PROMPT} code requires a message to display. When entering these codes, WordPerfect prompt you to provide the arguments. Press [Enter] when done. After you have finished writing the primary file template, save it to disk and clear the screen.

Here's an example of a boilerplate primary merge document.

{DATE} 
{PROMPT}Enter first name and last name~{KEYBOARD} 
{PROMPT}Enter address~{KEYBOARD} 
{PROMPT}Enter city, state, and ZIP code~{KEYBOARD} 
Dear {PROMPT}Enter salutation and last name~{KEYBOARD}: 

We are sure that you will object to this kind reminder that there is a
balance of {PROMPT}Enter balance due~{KEYBOARD} on your charge
account. 
If you have not mailed your check, do so now.  Please disregard this
notice if payment has already been made.  Thank you for your payment. 

Sincerely, 
<name> 

Save the template document and clear the screen. Follow these steps to use the template in an actual manual-merge operation:

Key Sequence What it Does
1. [Ctrl]-[F9] Chooses Merge/Sort key.
2. M Selects merge option.
3. {template name}
[Enter]
Indicates the template to use (use the name you saved the template document under).
4. [Enter] Skips the Secondary file: prompt.

WordPerfect reads the primary merge document and stops at the first message. In the case of the example, enter the first and last name, but instead of pressing [Enter] at the end of the entry, press [F9]. This indicates the end of keyboard entry to WordPerfect (the [F9] key normally prints an {END FIELD} code). Repeat the procedure for the rest of the messages.

The merge ends when you have responded to all of the messages. You may now print the file or save it on disk for future use.


Automatic Repeat

If you have many copies of the merged document to send out, you may wish to add an automatic repeating feature to the primary file. At the bottom of the document, add a hard page (press [Ctrl]-[Enter]), and on the next line:

{CHAIN PRIMARY}name~

In place of name, enter the name of the primary merge document you've been using. The end effect is that WordPerfect automatically repeats the merge operation. After entering the data for the first letter, WordPerfect adds a hard page to separate the letters and begins again.

When you get to the last letter, fill it out as usual (press [F9] to go to the each step of the merge). When you are done, press [Shift]-[F9], then S (for Stop). This stops the merge. If you choose Q (for Quit), the {CHAIN PRIMARY} command will be included at the end of the last letter.

DO NOT press the Cancel key, [F1], to stop the merge. If you do, you'll be stuck with a *Merging* prompt at the lower left corner of the screen. If this occurs, merely press [Shift]-[F9], then press S.


Using the {DOCUMENT} Command

The {DOCUMENT} merge command lets you merge the contents of entire documents together. The basic idea is similar to Master Document compilation, except that WordPerfect compiles the finished documents on the fly as a merge operation. For every {DOCUMENT} command in a primary merge document, you provide the name of the text document you want to insert. The contents of the imported document can be just a few characters to dozens of pages (if you're working with large documents you should use the Master Document feature instead).

For instance, to merge the contents of DOC1.TXT and DOC2.TXT into one file, you'd create the following primary merge document:

{DOCUMENT}DOC1.TXT~{DOCUMENT}DOC2.TXT~

When you run this merge (you need only specify the primary merge document in this case), WordPerfect captures the contents of DOC1.TXT and puts it in the current document, then adds the contents of DOC2.TXT.

One use of the {DOCUMENT} command in a real-world situation is importing just those portions of text you want to include in a letter. Of course, you can use it for any document that you build in boilerplate pieces, such as a proposal or contract. The primary merge document shown below performs the following tasks:

  1. Builds the start of the letter, including letterhead (if needed), and date.
  2. Prompts you for the addressee's name and address.
  3. Prompts you for the salutation.
  4. Prompts you for the boilerplate text to merge into the letter (you can also provide a menu of the available choices, if you desire).
  5. Repeats step 4 until the letter is finished.
  6. Closes the letter with your signature block.

The following merge is designed so that you can use it with little or no customizing. If you wish, you can exchange the "Enter the document to import" prompt with a menu of available boilerplate text documents. You can either select the document to use from a numbered list, or require the user to explicitly enter the document name. The DOCUMENT.PRI merge document is located in the MERGE subdirectory on the Applications Disk.


DOCUMENT.PRI (provided on the Applications Disk)

{DATE}

{PROMPT}Addressee's name and address; press F9 when done~{KEYBOARD}

Dear {PROMPT}Salutation; press F9 when done~{KEYBOARD}:

{LABEL}loop~{COMMENT}
~{TEXT}doc~Document to import; press Enter when done  ~{COMMENT}
~{DOCUMENT}{VARIABLE}doc~~{REWRITE}{COMMENT}
~{CHAR}key~Import another document? (y/n)  ~{COMMENT}
~{IF}"{VARIABLE}key~"="y"|"{VARIABLE}key~"="Y"~{COMMENT}
~{GO}loop~{ELSE}{GO}close~{END IF}{COMMENT}
~{LABEL}close~

Sincerely,

{PROMPT}Your name; press F9 when done~{KEYBOARD}

Note that the boilerplate documents you use should already be formatted for merging. If each document is a separate paragraph in a contract, for example, you'll want to format the text with lines above and below the paragraph. Otherwise, when merged the text may run together.


Merging From a Secondary File

Direct keyboard entry is the easiest and most straightforward method of merging text with a primary document, but the data you enter is used one time only. If you need (or want) to keep track of the correspondence that you mail out, enter the data first in a secondary file and use the secondary file for merging.

The basic layout of the merge document remains the same when using a secondary merge file, but you don't use {PROMPT} and {KEYBOARD} codes unless you specifically want to stop the merge to enter something special from the keyboard. Place the standard {FIELD} codes to indicate where the merged data should appear.

A normally time consuming and bothersome task is creating the secondary file, but the automatic secondary file generator macro detailed here can speed up the process greatly. The macro asks for the name, address, and amount due from customers' charge accounts. You can modify the macro to include other types of data. Just add or replace the {INPUT} instructions with others of your choice. The order with which you place the {INPUT} instructions determines the order of the fields in each secondary file record. With the example shown,

Field   Contents 
1 	First name
2 	Last name
3 	Street address
4 	City
5 	State
6 	ZIP code
7 	Amount due

Compare these field numbers with their corresponding positions in the primary file.

AUTOMRG.WPM (provided on the Applications Disk)

1.  {LABEL}loop~
    {CANCEL OFF}
    {INPUT}Enter the first name  ~{End Field}
    {INPUT}Enter the last name  ~{End Field}
    {INPUT}Enter the street address  ~{End Field}
    {INPUT}Enter the city (no comma)  ~{End Field}
    {INPUT}Enter the state  ~{End Field}
    {INPUT}Enter the ZIP code  ~{End Field}
    {INPUT}Enter the amount due (no dollar sign needed)  ~
    {End Field}{Merge Codes}E
2.  {CANCEL ON}
3.  {CHAR}key~Do another record (y/n)?  ~
    {IF}"{VARIABLE}key~"="y"|"{VARIABLE}key~"="Y"~
        {GO}loop~
    {END IF}
4.  {LABEL}append~
    {Home}{Home}{Up}
    {Block}
    {Home}{Home}{Down}
    {TEXT}name~Enter the name of the secondary file  ~
    {Block Append}{VARIABLE}name~{Enter}
    {Exit}nn
    {QUIT}

NOTE: You can't cancel macro execution while WordPerfect prompts you to enter field data. If you want to stop, press [Enter] until the "Do another record" prompt appears, then press the Cancel key.

Using Merge to Create Secondary File

You can also use a primary merge document to create a secondary merge document. For your convenience, this primary merge document is provided on the Applications Disk in the MERGE subdirectory. You'll probably want to modify the merge to suit your individual needs.


INPUT.PRI (provided on the Applications Disk)

{LABEL}loop~{COMMENT}
~{INPUT}Enter last name~{MRG CMND}{END FIELD}{MRG CMND}
{INPUT}Enter first name~{MRG CMND}{END FIELD}{MRG CMND}
{INPUT}Enter address~{MRG CMND}{END FIELD}{MRG CMND}
{INPUT}Enter city~{MRG CMND}{END FIELD}{MRG CMND}
{INPUT}Enter state~{MRG CMND}{END FIELD}{MRG CMND}
{INPUT}Enter ZIP code~{MRG CMND}{END FIELD}{MRG CMND}
{INPUT}Enter amount due~{MRG CMND}{END FIELD}{MRG CMND}{MRG CMND}
{END RECORD}{MRG CMND}{COMMENT}
~{CHAR}key~Do another? (y/n) 
~{COMMENT}~{IF}"{VARIABLE}key~"="y"|"{VARIABLE}key~"="Y"~{COMMENT}~{GO}loop~{END IF}

This example shows how to offer the same basic functionality of the AUTOMRG.WPM macro. As merges cannot access WordPerfect feature keys, the merge cannot automatically block and append the new records to a secondary file. You'll have to do that manually, or create a separate macro that includes the block/append sequence from Step 4 from AUTOMRG.WPM. You can automatically start the block/append sequence macro from the merge by adding

{CHAIN MACRO}macro~

at the very end of the INPUT.PRI merge document.


Ready-Made Merge Templates

Here is an assortment of business letter templates that are designed for merging with WordPerfect. In each letter, fields provide spaces to place name, address, salutation, and variable information pertinent to the subject of the letter. For example, in addition to the standard name and address, the letter BDCHECK indicates the number, amount, and date written for a check that has been returned unpaid from a bank. Like the name and address, the three special items are merge fields.

While you may generate secondary data files for use with these templates, you may find it easier -- if you have only a few letters to mail out each day -- to enter the information directly from the keyboard. All of the business letters, which are included on the Application Disk (in the MERGE subdirectory, under the names specified), use this field entry convention:

Field   Purpose
1 	First name
2 	Last name
3 	Street address
4 	City
5 	State
6 	ZIP code
7 	Misc. item 1
8 	Misc. item 2
9 	Misc. item 3
10	Misc. item 4

If you already have a data file with customer names and addresses, you may have entered the information in a different order or manner (for example, you may use field names instead of numbers). You'll need to modify the business letters before you can use them with your data file.


LATEREMD.PRI

This letter reminds customers to take care of their overdue bill. You can change the wording to make it softer or harsher, as required.

Field   	Purpose
{DATE}  	Automatic date
{FIELD}1~	First name
{FIELD}2~	Last name
{FIELD}3~	Street address
{FIELD}4~	City
{FIELD}5~	State
{FIELD}6~	ZIP code
{FIELD}7~	Balance due


BDCHECK.PRI

The BDCHECK.PRI template serves as a kind announcement that a customer's check has been returned unpaid by the bank. The letter provides spaces for check number, amount, and date written, as well as moneys due (check amount plus bank and services charges).

Field   	Purpose
{DATE}  	Automatic date
{FIELD}1~	First name
{FIELD}2~	Last name
{FIELD}3~	Street address{FIELD}4~City
{FIELD}5~	State
{FIELD}6~	ZIP code
{FIELD}7~	Check number
{FIELD)8~	Check face amount
{FIELD}9~	Check date written
{FIELD}10~    	Amount due (with service charges)


QUOTE.PRI

Send out this template when you wish to receive quotes for services or products. You may ask for a quote on only one item, but you are able to specify a maximum price and delivery time you are willing to consider. When requesting quotes for products, you may want to include an additional field that indicates the approximate quantity per month your company will be buying.

Field   	Purpose
{DATE}  	Automatic date
{FIELD}1~	First name
{FIELD}2~	Last name
{FIELD}3~	Street address
{FIELD}4~	City
{FIELD}5~	State
{FIELD}6~	ZIP code{FIELD}7~Quote for item


RESREPLY.PRI

Responding to resumes and employment applications submitted by mail is a common business courtesy. The RESREPLY.PRI template provides a fast and painless way to respond to those candidates that don't meet your employment criteria. You've probably gotten letters like this one yourself some time in your professional career, so the contents are fairly familiar to you.

Field   	Purpose
{DATE}  	Automatic date
{FIELD}1~	First name
{FIELD}2~	Last name
{FIELD}3~	Street address
{FIELD}4~	City
{FIELD}5~	State
{FIELD}6~	ZIP code
{FIELD}7~	Position applied for

 

MACRO-DRIVEN BOILERPLATE DOCUMENTS

Let's say that you are in the mail order business, and you sell a series of books on gardening. You are tired of writing, from scratch, the various reply letters that you send to customers. Some say, "thank you, the book is enclosed"; others say that "payment is insufficient," "payment was not enclosed," or "here is the information you requested." What you need is a system of document assembly macros that you can execute depending on the circumstances.


Using Macros for Manual Document Assembly

One method of manually implementing document macros is to use a crib sheet that outlines the steps necessary to produce a letter. As the crib sheets says, you first start with the ORDRPLY.WPM macro, which opens the main document template (ORDRPLY.TXT) and automatically enters the date. You then type the name and address of the customer, followed with a salutation. You now have three more steps, with several choices in each step.

Setting up the reply system, in this case for a fictitious book called "Successful Indoor Gardening On a Budget" (a "perennial" best-seller, to say the least!), requires you to create each macro and enter the text boilerplate you want included. These macros are not provided on the Applications Disk.

Note the {PROMPT} instruction in ORDRPLY.WPM. It displays, in bold letters, "Type the name and address." The computer beeps and the prompt stays on the screen for two seconds (20/10ths of a second).

Also note the {TEXT} instruction in the NSFPAY.WPM macro. It asks to enter the amount due and press Enter. Your entry is stored in variable 1 and printed directly into the letter. The dollar sign is part of the macro so you don't need to enter it yourself, but you do need to include any decimal points or commas.

It would be nice to have WordPerfect calculate the balance due based on the amount remitted and the cost of book, but if you're working with fractional numbers it can't be done using variables. Unfortunately, WordPerfect variables perform math with whole numbers only.

The format for the ORDRPLY.TXT document includes a letterhead embedded in the header. Delete the header if you are using letterhead paper stock. Formatting codes used in the document include:

 

Using Macros for Automatic Document Assembly

A more stream-lined version of the customer reply letter involves a main macro that includes one-line prompt menus and several branch macros that contain the boilerplate text you want to use. The system uses merge printing and a pre-defined primary document, named ORDER.PRI that comprises nothing but fields for entering the name and address of the customer.

Although the example shown here is designed to produce reply letters for a fictitious product, you can readily modify the system to suit your own requirements. If your modifications are extensive, consult Chapter 9 for an explanation of how to use macros to make on-screen menus.

Note that MRGORD.WPM uses the current document screen (Doc 1 or Doc 2, which ever is currently on the screen). The document screen MUST be empty or the macro will not run. To clear the document, press [F7] nn.


MRGORD.WPM (provided on the Applications Disk

1.  {IF}{SYSTEM}document~=256~ 
    {ELSE} 
      {QUIT} 
    {END IF}
2.  {LABEL}start~ 
    {TEXT}key~Enter first name  ~{VARIABLE}key~{End Field} 
    {TEXT}key~Enter the last name  ~{VARIABLE}key~{End Field} 
    {TEXT}key~Enter the company (if any)  ~{VARIABLE}key~{End Field} 
    {TEXT}key~Enter the street address  ~{VARIABLE}key~{End Field} 
    {TEXT}key~Enter the city  ~{VARIABLE}key~{End Field} 
    {TEXT}key~Enter the state  ~{VARIABLE}key~{End Field} 
    {TEXT}key~Enter the ZIP code  ~{VARIABLE}key~{End Field} 
3.  {LABEL}loop1~ 
    {CHAR}key~Is this an: {^]}1{^\} Order  {^]}2{^\} Inquiry?  ~ 
    {IF}{VARIABLE}key~=1~ 
       {NEST}tyord~ 
       {GO}orderbody~ 
    {ELSE} 
    {IF}{VARIABLE}key~=2~ 
       {NEST}tyinq~ 
       {NEST}clinq~ 
       {GO}do_another~ 
    {ELSE} 
       {PROMPT}Press 1 or 2 only  ~ 
       {BELL} 
       {WAIT}15~ 
       {GO}loop1~ 
    {END IF}{END IF}  
4.  {LABEL}orderbody~ 
    {LABEL}loop2~ 
    {CHAR}key~ 
      {^]}1{^\} Order is complete   
      {^]}2{^\} No money   
      {^]}3{^\} Insufficient Payment  ~ 
    {IF}{VARIABLE}key~=1~ 
       {NEST}ordenc~ 
       {NEST}clord~ 
    {ELSE} 
    {IF}{VARIABLE}key~=2~ 
       {NEST}nopay~ 
       {NEST}clinq~ 
    {ELSE} 
    {IF}{VARIABLE}key~=3~ 
       {NEST}nsfpay~ 
       {NEST}clinq~ 
    {ELSE} 
       {PROMPT}Press 1, 2, or 3.  ~{BELL} 
       {WAIT}15~ 
       {GO}loop2~ 
    {END IF}{END IF}{END IF} 
5.  {LABEL}do_another~ 
    {Merge Codes}E 
    {CHAR}key~Do another? ({^]}y{^\}/{^]}n{^\})  ~ 
    {CASE}{VARIABLE}key~~ y~start~ Y~start~ 
      n~merge~ N~merge~~ 
    {PROMPT}Press y or n.  ~ 
    {BELL}{WAIT}15~ 
    {GO}do_another~ 
6.  {LABEL}merge~ 
    {DISPLAY OFF} 
    {Save}order.sec{Enter} 
    {IF}{STATE}&1024~ 
       y 
       {GO}startmrg~ 
    {ELSE} 
       {GO}startmrg~ 
    {END IF} 
7.  {LABEL}startmrg~ 
    {Exit}nn 
    {Merge/Sort}M 
    order.pri{Enter} 
    order.sec{Enter}

IMPORTANT NOTE: MRGORD.WPM is designed to be used with Short Document names, as with the Setup key (not under List files). If you are using Long Document names (and provide a long name, summary, and DOS name for all documents you create), see Chapter 18, "Macro Strategies," for information on how to modify this macro to accept Long Document input.

The MRGORD.WPM automatic document assembly macro uses same boilerplate macros described earlier in this chapter.


Reply Letters With Automatic Labels

With the reply letter prepared it's now time to send it off in the mail -- but wait! You still must address the envelope so the letter gets to its proper destination. You don't want to hand write the address because that looks tacky, and it's a waste of time to retype them onto label stock. Since you already entered the name and address for the letter, why not use the same information to prepare quick mailing labels from within WordPerfect.

You need a primary merge document that contains the fields and formatting for the label stock. The construction of the primary label document is shown at the end of this section. The MRGORD1.WPM macro, detailed below, is based on MRGORD.WPM; the main difference is the label making routine at the end of the macro. Note that MRGORD1.WPM uses both Doc 1 and Doc 2, which MUST be empty before you start the macro.


MRGORD1.WPM (provided on the Applications Disk)

{CALL}check_doc~ 
{Switch} 
{CALL}check_doc~ 
{Switch} 
{GO}start~ 

{LABEL}check_doc~ 
{IF}{SYSTEM}document~=256~ 
    {RETURN} 
{ELSE} 
    {QUIT} {END IF} 

{LABEL}start~ 
{TEXT}fName~Enter first name  ~{VARIABLE}fName~{End Field} 
{TEXT}lName~Enter the last name  ~{VARIABLE}lName~{End Field} 
{TEXT}company~Enter the company (if any)~{VARIABLE}company~{End Field}

{TEXT}address~Enter the street address  ~{VARIABLE}address~{End Field}

{TEXT}city~Enter the city  ~{VARIABLE}city~{End Field} 
{TEXT}state~Enter the state  ~{VARIABLE}state~{End Field} 
{TEXT}zip~Enter the ZIP code  ~{VARIABLE}zip~{End Field} 
{CALL}addlabel~ 

{LABEL}loop1~ 
{CHAR}key~Is this an: {^]}1{^\} Order  {^]}2{^\} Inquiry?  ~ 
{IF}{VARIABLE}key~=1~ 
    {NEST}tyord~ 
    {GO}orderbody~ 
{ELSE} 
    {IF}{VARIABLE}key~=2~ 
    {NEST}tyinq~ 
    {NEST}clinq~ 
    {GO}do_another~ {ELSE} 
    {PROMPT}Press 1 or 2 only  ~ 
    {BELL}{WAIT}15~ 
    {GO}loop1~ 
{END IF}{END IF} 

{LABEL}orderbody~ 
{LABEL}loop2~ 
{CHAR}key~ 
    {^]}1{^\} Order is complete   
    {^]}2{^\} No money   
    {^]}3{^\} Insufficient Payment  ~ 
{IF}{VARIABLE}key~=1~ 
    {NEST}ordenc~ 
    {NEST}clord~ 
{ELSE} 
    {IF}{VARIABLE}key~=2~ 
    {NEST}nopay~ 
    {NEST}clinq~ 
{ELSE} 
    {IF}{VARIABLE}key~=3~ 
    {NEST}nsfpay~ 
    {NEST}clinq~ 
{ELSE} 
    {PROMPT}Press 1, 2, or 3  ~ 
   {BELL}{WAIT}15~{GO}loop2~ 
{END IF}{END IF}{END IF} 

{LABEL}do_another~ 
{Merge Codes}E 
{CHAR}key~Do another?  (y/n)~ 
{CASE}{VARIABLE}key~~ 
    y~start~ Y~start~ 
    n~merge~ N~merge~ 
    ~ 
{PROMPT}Press y or n.  ~ 
{BELL}{WAIT}15~ 
{GO}do_another~ 

{LABEL}merge~ 
{DISPLAY OFF} 
{Save}order.sec{Enter} 
{IF}{STATE}&1024~ 
    y 
    {GO}startmrg~ 
{ELSE} 
    {GO}startmrg~ 
{END IF} 

{LABEL}startmrg~ 
{Exit}nn {Merge/Sort}M 
order.pri{Enter} 
order.sec{Enter} 
{GO}mrglabel~ 

{LABEL}addlabel~ 
{DISPLAY OFF}{Switch} 
{VARIABLE}fName~{End Field} 
{VARIABLE}lName~{End Field} 
{VARIABLE}company~{End Field} 
{VARIABLE}address~{End Field} 
{VARIABLE}city~{End Field} 
{VARIABLE}state~{End Field} 
{VARIABLE}zip~{End Field} 
{Merge Codes}E 
{Switch}{DISPLAY ON} 
{RETURN} 

{LABEL}mrglabel~ 
{DISPLAY OFF}{Switch} 
{Save}labels.sec{Enter} 
{IF}{STATE}&1024~ 
    y 
    {GO}dolabel~ 
{ELSE} 
    {GO}dolabel~ {END IF} 

{LABEL}dolabel~ 
{Exit}nn 
{Merge/Sort}M 
labels.pri{Enter} 
labels.sec{Enter} 
{Switch} 

Doc 1 now holds the letters, ready for printing; Doc 2 now holds the labels, ready for printing. With fan-fold paper or stationary in the printer, print the contents of Doc 1. Switch over to Doc 2, change the paper to label stock, and print.

The LABELS.PRI file is made to work with standard 1 by 3 inch, one-up labels. The fields show the layout for the name and address. To accommodate the label stock, make these format changes for the LABELS.PRI document.

Be sure to set the new margins before setting the paper size. If you have already created a label form (using WordPerfect's Form feature), choose it from within the Format menu instead of manually entering the page size and type. At printing, WordPerfect will stop and ask you to change paper stock. To start the actual printing,

Key Sequence What it Does
1. [Shift]-[F7] Chooses Print command.
2. C Selects Control Printer option (the current print job is shown waiting in the queue).
3. G Chooses Go option; printing starts.

 

---

 Top Contents

WordPerfect 5.1 Macros and Templates
Electronic Edition
Copyright 1990, 1997, Gordon McComb.  All Rights Reserved.
First published by Bantam Electronic Publishing, 1990.
http://www.gmccomb.com/