Information Technology Topic

Mail Merge

  1. Read notes
  2. Flashcards
  3. Quiz
  4. Confident

Study focus - 3 things

  1. Mail merge makes many copies of one document with different details in each, by joining a primary document (the fixed text and merge fields) to a data file (a table of records)
  2. Each column of the data file is a field with a field name, each row is a record, and a full merge makes one merged letter for every record
  3. You can merge all records or only selected ones, send the result to the printer or save it to a file for editing, and keep the primary document as a reusable template

Visual notes

From two files to one letter per record
A flow sketch in three steps. Step 1, the primary document, is a short letter: Dear Title Surname, Our records show that J$ Amount is due for the Group squad. Please pay at the next training session. The fields Title, Surname, Amount and Group are shown as green markers. Step 2, the data file, is a table with the field names Title, Surname, Group, Amount across the top and 6 records below, one row for each member. Step 3, a merge arrow leads to the merged output of 6 letters. The first letter reads: Dear Mrs Reid, Our records show that J$3200 is due for the Junior squad. Please pay at the next training session.

The primary document and the data file are merged into 6 letters, one for each of the 6 records.

Section 1One letter, many people

A swimming club in Portmore must tell six families how much they owe in training fees. The letter is the same for everyone, except for the name, the squad and the amount. Typing six letters is slow and every retyped line is a chance for a mistake. Mail merge is the fix. It makes many copies of one document with variable details such as names, addresses and amounts. Typical uses are form letters, mailing labels and envelopes. Here's the trick: whenever the same document must go to lots of people with a few details changed, think mail merge.

Section 2Two files make the merge

A mail merge needs two things. The primary document (also called the main document) carries the fixed text, the words that are the same in every copy. The data file holds the details that change. The merge joins them. The result is the merged output: one finished letter for each record in the data file. Easy to mix up: the primary document is not the finished letter. It is the pattern, with gaps where each person's details will go.

Section 3Records, fields and field names

The data file is a table of records. Each row is one record, and here a record is one person's details. Each column is a field, and the heading at the top of the column is the field name. The swim club's file has four field names (Title, Surname, Group and Amount) and six records. The header row holds the names and is not a record, so there are 6 records, not 7. A full merge makes one letter per record. Six records give 6 letters.

Section 4The data file and its field names

The details can come from a spreadsheet, from a text file such as a CSV file, or from a database. A CSV (comma-separated values) file is a text file in which each line is a row and the cells are separated by commas. If the merge program cannot read your file directly, convert it first, for example to CSV. The field names in the data file must be matched to the names the merge tool expects. Suppose your column is called Last Name but the tool expects Surname. You must match Last Name to Surname, or the tool will not know which column holds the surname. Watch out: a few minutes spent checking headings and empty cells in the data file saves reprinting later.

Section 5Building the primary document

Type the fixed text as normal. Then place a merge field wherever each person's details should appear. Only the field is inserted, so the letter shows a marker such as «Surname» that the merge replaces with the real surname. Punctuation and spaces between fields are typed by you. In Dear «Title» «Surname», the space between the two fields and the comma after the second are your typing. If a field is empty for some records, for example a second address line, a blank line can appear. Many tools let you suppress these blank lines so the letter closes up neatly.

Section 6Running the merge

You can merge all records, or choose selected records only. A school might send a letter to Form 5A parents alone. You can also choose where the output goes: to the printer, or to a file for further editing. The primary document can be kept as a reusable template, so next term you only change the data file. Many merge tools offer a wizard that walks you through the steps, for example choosing the document type and the data source, then setting up the address and the greeting. The exact steps differ from one program to another.

Section 7Putting it together

Swim club: 6 records, 4 fields. Merge all records: 6 letters. Letter 4 begins Dear Mr Campbell, and says that J$4500 is due for the Senior squad. Merge only the Junior records: 4 letters, each asking for J$3200, which is J$12800 in all. Mandeville school: 5 records, with the Address 2 line empty for 2 of them. Without suppression, 2 letters have a blank line. With it, none do. Merge only Form 5A, and 3 letters are produced. If a surname is spelt wrongly, fix it once in the data file and merge again. Every letter is made fresh from the two files.

Examples

A swimming club in Portmore keeps this data file (field names in the first row): Title | Surname | Group | Amount Mrs | Reid | Junior | 3200 Mr | Brown | Senior | 4500 Ms | Clarke | Junior | 3200 Mr | Campbell | Senior | 4500 Mrs | Gordon | Junior | 3200 Mr | Hall | Junior | 3200 The primary document reads: Dear «Title» «Surname», Our records show that J$«Amount» is due for the «Group» squad. Please pay at the next training session. (a) State the number of records and the number of fields. (b) State how many letters a merge of the whole file produces. (c) Write the first two lines of letter 4. (d) The secretary merges only the Junior records. State how many letters are produced and the total amount they ask for.

(a) The first row holds the field names, so it is not a record. There are 6 records (one per member) and 4 fields (Title, Surname, Group and Amount). (b) A full merge makes one letter for each record, so 6 letters. (c) Letter 4 uses the fourth record, Mr Campbell, Senior, 4500. The lines are: Dear Mr Campbell, and Our records show that J$4500 is due for the Senior squad. (d) The Junior records are Reid, Clarke, Gordon and Hall, so 4 letters are produced. Each asks for J$3200, so the total is 4 × 3200 = J$12800.

A school in Mandeville merges a letter to parents of Form 5 students. The data file has the fields Last Name, First Name, Address 1, Address 2 and Form. The letter starts with a three-line address block: First Name and Surname on line 1, Address 1 on line 2 and Address 2 on line 3. Brown | Andre | 14 Cedar Avenue | Mandeville | 5A Clarke | Shanice | 7 Mango Lane | (empty) | 5B Gordon | Tyrone | 31 School Lane | Christiana | 5A Hall | Janelle | 9 Palm Close | (empty) | 5A Reid | Kemar | 22 Hill Road | Mandeville | 5B (a) The letter uses a field called Surname. Explain what must be done before the merge. (b) State how many letters a full merge produces and how many of them have a blank address line when blank lines are not suppressed. (c) State how many address lines Shanice Clarke's letter has when blank lines are suppressed. (d) The head teacher wants only Form 5A parents to receive the letter. State how many letters are produced and whose they are.

(a) The data file calls the column Last Name, but the letter needs Surname. The field names must be matched, so Last Name is matched to Surname. Otherwise the merge tool does not know which column holds the surname. (b) There are 5 records, so a full merge makes 5 letters. Address 2 is empty for Clarke and Hall, so 2 letters have a blank line. (c) With suppression, the empty third line is dropped. Shanice's address block has 2 lines: Shanice Clarke and 7 Mango Lane. (d) Choose selected records where Form is 5A. The records are Brown, Gordon and Hall, so 3 letters are produced, for Andre, Tyrone and Janelle.

Now let's water it

Session runs notes to flashcards to quiz back-to-back.

Where this comes from