Creating a form letter

From Apache OpenOffice Wiki
Jump to: navigation, search

Example: Sending a letter to your customer base

A mail order company organized a campaign to assign credit points to their customers according to the quantity of goods they buy during one year.

At the end of the year, they want to send a letter to each customer to show the total of credit points collected.

You can create a form letter manually, which is the simplest and most comprehensive method and is described here, or you can use the Mail Merge wizard as described in Using the Mail Merge Wizard to create a form letter. If you elect to use the wizard, pay close attention to its current limitations, as identified within its description.

  1. Create a new text document: File > New > Text Document, or open a pre-existing form letter with File > Open.
  2. Display the registered data sources: View > Data sources (or press F4).
  3. Find the data source that you wish to use for the form letter, in this case Points. Expand the Points and Tables folders, and select Sheet1. The address data file is displayed.
    Selecting the data source.
  4. Now create or modify the form letter by typing in the text, punctuation, line breaks, and so on that will be present in all of the letters. To add the mail-merge fields where needed (such as names and addresses), click in the field heading and drag it to the appropriate point in the letter. (See Figure below).
    Documentation note.png The address lines should be in individual paragraphs, not separated by line breaks as might seem preferable. The reason for this will be made clear in the next step.
    Dragging fields to the body of the form letter
  5. Continue until you have composed the entire document. (See below for an example.) At this time you may wish to consider suppressing any blank lines that may appear in the resulting letters. If not, skip ahead to Step 7.
    The completed form letter.
  6. To suppress blank lines:
    1. Click at the end of the first paragraph to be suppressed and then select Insert > Fields > Other.
    2. Select the Functions tab and then click on Hidden Paragraph in the Type column.
    3. Now click in the Condition box and enter the details of the condition that defines a blank address field. It has the general form of:
    4. ![Database.Table.Database field]

      where the ‘!’ (NOT) character indicates the negative case and the square brackets indicate the condition.

      For example, in our Points database the condition to test if the Company field is empty would be:

      ![Points.Sheet1.Company] as illustrated below.

      Hidden paragraph insertion.

      To test for multiple conditions use the operators AND and/or OR between the conditional statements, for example:

      ![Points.Sheet1.Title]AND![Points.Sheet1.Last Name]

    5. Click Insert, but do not close the dialog until you have amended all the lines that should be suppressed.

    The document is now ready to be printed.

    1. Click File > Print and respond with Yes in the message box.
    2. Confirmation message for merging database fields.
    3. In the Mail Merge dialog, you can choose to print all records or selected records. To select records to be printed, use Ctrl+click to select individual records. To select a block of records, select the first record in the block, scroll to the last record in the block, and Shift+click on the last record.
    4. The Mail Merge dialog.
    5. Click OK to send the letters directly to the printer.
    6. If you prefer to save the letters to a file, perhaps to allow proofreading or some later formatting, select File in the output section of the Mail Merge dialog, instead of using the default Printer selection. This changes the dialog to display the Save merged document section, where Save as single document is pre-selected. You can choose to save each letter as a single, individual document, if preferred.

      In this case, clicking OK brings up the Save as dialog. Enter a file name for the saved letters. They will be saved consecutively in the single document, or numbered consecutively in individual files if saved as single documents.

    7. If you have not saved the original, prototype form letter document (template) previously, then you should do so now. Having a form letter template could greatly simplify the creation of other form letters in the future and is highly recommended.
    Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY).
Personal tools