At its most basic a mail merge is a way of laying out something and then having it automatically generate many copies of the same thing but with certain areas changed or personalised by using a file from a spreadsheet.
The obvious example that everyone will have at least heard about is using a database of customers to personalise a letter. So lets have a look at that first. Lets say I need to design a promotional letter, or mail shot, to be sent out to all of a clients customer's and both the address and the "Dear Sir" part, or saultation, will be personalised to each customer. The address will need to be seen through the window area of this envelope'
So here is the design laid out. It has the company logo, just like their letterhead, a promotional offer and the address has been set to fall within the window area of the letter.
Next we need to look at our database. The HEADINGS at the top of the database are the key. When you import your data into your design it is the headings which you will be placing and styling. Then when you are happy with everything the data merge will replace the headings with the actual information in the spreadsheet. The headings run across the top of the file in Row 1 - here they begin first name, last name, company name, address etc.
N.B. You will almost certainly be supplied the spreadsheet as an Xcel file or something similar. In order to use this you must open the file in your spreadsheet application and save a copy as a .csv (comma separated values) file. This is the format which InDesign uses.
Once you have done that return to InDesign and go ahead and open the data Merge pane (Window > Utilities > Data Merge)
and from there browse to your newly saved .csv file. You will see that the Data Merge pane is now populated with the headings from the .csv file.
Now, in your letter layout, select the piece of text for the first name, in this case "Joe" and while it is still selected double click the corresponding heading in the Data Merge pane, i.e. "first_name". You will see that "Joe" has been replaced with the heading "first_name" with a couple of odd brackets around it to show it is now linked to the data merge.
When you do your merge InDesign will replace <<first_name>>, one by one, letter by letter, with the list of names in the "first_name" column of the .csv file. But first go ahead and fill the rest of the fields.
Notice that the headings are slightly different to how I initially imagined them. For example, there is now a company name that I hadn't anticipated but thats ok. Also notice that the style of the text has taken on the size, leading, colour and stye I used to lay out the letter. Had I designed the address to be an orange, undelined, marker script then the data would be the same… and I can still change it now if I wish. Also notice that I have manually inserted a comma at the end of each line and a full stop to finish the address as these aren't part of the data.
Finally, using the same process you can also go ahead and personalise the "Dear Mr. Bloggs" section.
Now you are ready to create your merge. In the little fly out menu on the Data Merge pane you will see several options. Preview will let you preview how your merge looks. Create Merged Document will create an NEW document with a letter per page, each filled with the correct data from the .csv file.
In general you can leave things set as they are, but on the third tab "Options" there is an option to "Remove blank lines for empty fields" this will stop Indesign creating a blank line if a field in the .cv file is empty, e.g. if there is no company name then the gap between the lines will be closed up.
And here is the final result.
NB You should save BOTH your original file and the new merged one in case you need to repeat the merge again.
Next time I will show you how to use mail merge more creatively and even merge images!