@database @node main chapter12 12 FORM LETTERS @{" PRODUCING FORM LETTERS " LINK 12-1} Producing form letters ......................@{" 12-2 " LINK 12-2} Program interface with Final Data ...........@{" 12-3 " LINK 12-3} Creating a data file through ASCII ..........@{" 12-3a " LINK 12-3a} Tips for setting up a data file ........@{" 12-4 " LINK 12-4} Saving a data file ..........................@{" 12-5 " LINK 12-5} Creating a form letter ......................@{" 12-6 " LINK 12-6} Changing type attributes ...............@{" 12-9 " LINK 12-9} Changing data name .....................@{" 12-9a " LINK 12-9a} Removing a merge field..................@{" 12-10 " LINK 12-10} Saving a form letter ...................@{" 12-10a " LINK 12-10a} Merging data with a form letter .............@{" 12-10b " LINK 12-10b} @endnode @node 12-1 FROM LETTERS With Final Writer, you can create a form letter, a list of recipients and print an individualized copy of the form letter for each recipient. Included in this chapter are instructions on: * program interface. * Creating and saving merge data. * Creating a form letter. * Merging data with a form letter. 12-1 Form Letter @endnode @node 12-2 PRODUCING FORM LETTERS To print form letters in Final Writer, you need: * A form letter document containing the text that is the same for every copy of the letter, and indication where custom data unique for each copy is to be inserted. * A data file containing actual information that is different for each letter, such as names and addresses of recipients. The form letter and the data file are combined using the "Print Merge" command to print individualized form letter. *** @{" See Fig 12-1 " system "ps fw_41:fig12-1"} *** Form Letters 12-2 @endnode @node 12-3 PROGRAM INTERFACE WITH FINAL DATA Final Writer`s "Print Merge" feature works directly with databases created in Softwood`s Final Data database manager as well as ASCII files. If you use Final Data, you can "Print Merge" with Final Writer without going through the extra step of saving an ASCII data file within Final Data. When you specify the file name to be used, the program will automatically detect it as Final Data database rather than an ASCII file. You don`t have to do anything special to indicate the file is in Final Data format. @endnode @node 12-3a CREATING A DATA FILE THROUGH ASCII In the discussions that follow, "row" is used to refer to a collection of related data: and "field" is used to refer to a piece of data within a row. For example in a name and address data file, a row refers to all the information for one person; while field refers to a person`s name. A data file is an ASCII disk file where fields are separated by comma or tab characters, and rows are separated by a NEWLINE (0x0a) or RETURN (0x0d) character. For example, in a name and address data file, each person`s name and address information (row) is separated from another person`s name and address, by a NEWLINE or RETURN character. Within each row the name, address, city, state, etc., fields are separated from each other by either a comma or tab character. Although either a tab or comma can be used to separate data, only one method can be used in any given data file. Therefore, if data is separated with a tab for one row of data, a comma can not be used to separate data in another row. Final Writer uses the first row of a data file to determine the names field. Therefore in a name and address data file, the first row could contain the words "First" "Last" "Address" "City", etc. Subsequent rows would contain the actual names and address. To summarize, the rules governing the format of data files that can be used in Final Writer`s Form Letter feature are: * For a data file other than Final Data, the file must be an ASCII data file. * Rows within a data file are separated by either a NEW LINE or a RETURN character. * Fields within a row are separated by either tab or comma character. Only one method of separating fields can be used in any given data file. Form Letters 12-3 * The first row of a data file must contain the names of the fields contained in the file. * The sequence of fields within a row must follow the sequence of field names used in the first row. A typical name and address data file might appear as: FIRST MIDDLE LAST STREET CITY STATE ZIP Woody Williams 120 Company Str. Tempe AZ 12345 Terry R. Wright 43 Sailboat Ave. Tempe AZ 32321 Mary B. Unes 55 Golf Street Phoenix AZ 39393 Pat Brouilette 23 Rock Climb Rd. Tempe AZ 38290 Ben Fuller 553 Amiga Lane Mesa AZ 3234 NOTE. Where a field does not exist within a row, only the separating character is entered. @endnode @node 12-4 TIPS FOR SETTING UP A DATA FILE DOCUMENT You may want to modify two preference settings to make entering, saving, and opening a data file more convenient. These preferences are: "TAB EVERY" VALUE Final Writer has a default tab distance value that is set in the "Document Preferences" requester. This value specifies the distance the program will move the insertion point whenever you press the TAB key where no tab stops are set. When you are creating a data file, and intend to use a tab character to separate data, you may want to set this value larger than Final Writer`s original default value. We recommend setting the "Tabs Every" value in the "Document Preferences" requester to at least .75 inches. *** @{" See Fig 12-2 " system "ps fw_41:fig12-2"} *** 12-4 Form Letters ASCII I/O PREFERENCES We recommend the following settings for the ASCII I/O Preferences used to read and write your data file. *** @{" See Fig 12-3 " system "ps fw_41:fig12-3"} *** @endnode @node 12-5 SAVING A DATA FILE If you use Final Writer to edit and save your data file, you will need to save it as an ASCII file. In order to do this properly, always use the "Save As" feature rather than "Save". The reason for this is that "Save" will always save an existing file as a formatted Final Writer document. By using the "Save As" feature, you can specify that the ASCII format is used. TO SAVE A DATA FILE IN FINAL WRITER: ------------------------------------------------------------------------ 1. Choose "Save As ..." from the "Project" menu. A file requester will appear. *** @{" See Fig 12-4 " system "ps fw_41:fig12-4"} *** 2. Use the file requester to locate where you want the data file to be saved. 3. In the "File" data entry area, enter whatever name you want to save the file. If you are saving a data file that already has been saved, click the mouse on the name of the file in the file requester`s list. 4. Click on the "Export ..." button in the file requester. A list of formats will be shown. *** @{" See Fig 12-5 " system "ps fw_41:fig12-5"} *** 5. Click on the word "ASCII", and then click on the "Save". The file will be saved as an ASCII file. @endnode @node 12-6 CREATING A FORM LETTER A form letter is created in Final Writer like any other document. The only difference is that wherever you want data merged into the text from a data file, you will choose the "Insert Item .. Merge Field .." menu section and specify the name of the field that is to be merged. Once a merge field definition has been inserted, you can change it, remove it, and even change its type attributes. TO INSERT A MERGE FIELD DEFINITION: ------------------------------------------------------------------------ 1. Make sure the insertion point is where you want data to be inserted from the data file. 12-6 Form Letters *** @{" See Fig 12-6 " system "ps fw_41:fig12-6"} *** 2. Choose "Merge Field" from the "Insert item" sub-menu located in the "Layout" menu. The "Select Merge Field" requester will be displayed. *** @{" See Fig 12-7 " system "ps fw_41:fig12-7"} *** 3. If the "Fields" list is empty: A. Click on the "Select" button. A file requester will appear. Form Letters 12-7 *** @{" See Fig 12-8 " system "ps fw_41:fig12-8"} *** B. Use the requester to locate a data file that contains the names of the merge fields in the first row of the file. C. Once the data file is located, double-click the mouse on its name. Final Writer will read the data file, locate the field names, and place the names into the "Fields Names" list. *** @{" See Fig 12-9 " system "ps fw_41:fig12-9"} *** 4. Double-click the mouse on the name of the field in the "Field Names" list whose data is to be merged. Final Writer will remove the requester, and insert the field`s name into your document surrounded by double-bracket characters. For example, "<>". 5. Continue typing your form letter and repeat the above steps for each merge field. 12-8 Form Letters @endnode @node 12-9 CHANGING A MERGE FIELD`S TYPE ATTRIBUTES A merge field created by Final Writer has its own unique type attributes. For example, your form letter could be in Times-Roman while data merged into a particular merge field could be Times-Bold. TO CHANGE A MERGE FIELD`S TYPE ATTRIBUTES: ------------------------------------------------------------------------ 1. Within the form letter document, click the mouse on the merge field whose attributes are to be changed. Final Writer will select the entire merge field including its surrounding brackets. 2. Choose "Type" from the "Layout" menu, then set the type attributes using the "Type Specs" requester. @endnode @node 12-9a CHANGING A MERGE FIELDS DATA NAME You can change your mind as to what field is to be merged in a merge field that is already defined. TO CHANGE A MERGE FIELDS DATA NAME: ------------------------------------------------------------------------ 1. Within the form letter document, click the mouse on the merge field whose data name is to be changed. Final Writer will select the entire field including its surrounding brackets. 2. Choose "Merge Field" from the "Update item" sub-menu located in the "Layout" menu. *** @{" See Fig 12-10 " system "ps fw_41:fig12-10"} *** The "Select Merge Field" requester will be displayed. 3. If the "Fields Names" list is empty: A. Click on the "Select..." button. A file requester will appear. B. Use the requester to locate a data file that contains the names of the merge fields in the first row of the file. C. Once the data file is located, double-click the mouse on its name. Form Letters 12-9 Final Writer will read the data file, locate the field names, and place the names into the "Fields Names" list. 4. Double-click the mouse on the name of the field in the "Field Names" list whose data is to be merged. Final Writer will remove the requester, and insert the fields name into your document replacing the name that was there before. @endnode @node 12-10 REMOVING A MERGE FIELD You can remove a merge field from a form letter at any time. TO REMOVE A MERGE FIELD: ------------------------------------------------------------------------ 1. Within the form letter document, click the mouse on the merge field to be removed. Final Writer will select the entire field including its surrounding brackets. 2. Press the DELETE or BACKSPACE key. The merge field will be removed from the document. @endnode @node 12-10a SAVING A FORM LETTER A form letter is saved as a Final Writer document. There is nothing special about saving a form letter - do it just as you save any other document. @endnode @node 12-10b MERGING DATA WITH A FORM LETTER Once you have created a from letter and a data file you can instruct Final Writer to merge the data file with the form letter. This process will print an individualized copy of the letter for each recipient in the data file. TO MERGE DATA WITH A FORM LETTER: ------------------------------------------------------------------------ 1. If the form letter document is not already open , choose "Open .." from the "Project" menu, and open the form letter like you do for any other document that you open. 12-10 Form Letters 2. Choose "Print Merge .." from the "Project" menu. Final Writer will display the "Select Merge Data" file requester. 3. Use the file requester to locate the data file you want to use for the merge. *** @{" See Fig 12-11 " system "ps fw_41:fig12-11"} *** 4. Once the data file is located , double-click the mouse on its name in the file requester's list. The "Select Merge Records" requester will appear. *** @{" See Fig 12-11 " system "ps fw_41:fig12-11"} *** Final Writer will analyze the data file and determine the number of rows (records) contained in the file. It will put the number "1" in the "From" range, and the last record number found in the "To" range. This gives you the ability to select which group of data records to be merged. This feature is handy if you have to restart a merge because of printer error or some other problem. 5. If you want to print all rows in the data file, click the mouse on "All". If you want to print a range of rows, click the mouse on the "Range", enter the beginning row # in the area labelled "From", and enter the ending row # in the area labelled "To". Form Letters 12-11 6. Click on the "OK" button in the "Select Merge Rows" requester. Final Writer will display the "Print Document" requester. *** @{" See Fig 12-12 " system "ps fw_41:fig12-12"} *** 7. Use this requester just as you would if printing a single document. Refer to Chapter 11 for details on using this requester. Final Writer will display the "Printing Document ..." requester and you will begin to merge rows of data with the form letter. Each page of the form letter will be printed for each data record merged. You can cancel this process at any time by clicking the mouse on the "Stop" button. 12-12 Form Letters Notes... Blank Page Form Letters 12-13 @endnode