Office software, documents & open source in South AfricaUpdated
Documents

Mail Merge in LibreOffice

Recipients' names, postcodes, and anything else unique to each copy go into a spreadsheet that Writer pulls the information from.

Mail Merge in LibreOffice
Photo: Martin Vorel / Public Domain / Wikimedia Commons

Recipients' names, postcodes, and anything else unique to each copy go into a spreadsheet that Writer pulls the information from.

Prepare the spreadsheet

Keep the merge data in a Calc spreadsheet. In Calc, set the data up with one header row, one person per row, avoiding empty rows. Save it, for example as an .ods file.

Plan your data:

  • At minimum, include fields for name and address.
  • Use only text, number, or date fields.

Register the data source and place fields

First register the spreadsheet as a data source, so Writer can read its column names.

  • Choose File > Wizards > Address Data Source.
  • Select Other external data source and click Next, then Settings. Choose Spreadsheet, click Next, browse to your file and click Finish.
  • Click Next to skip Field Assignment, check the name on the Data Source Title page and click Finish.
  • Open your letter, choose View > Data Sources, expand the new data source and its Tables, and click the sheet. Drag each column heading into the letter.
  • The document now contains mail merge fields, each looking like the name of the database field.

Preview and print the merge

Save the letter, then run the merge.

Choose File > Print and click Yes when Writer asks whether to print a form letter. In the Mail Merge dialog, choose all or selected records, then set Output to Printer, or to File and save as a single document or individual documents in a format such as PDF. Your spreadsheet columns will let you personalise the saved output.

Labels

For mailing labels, register the.ods spreadsheet data source and choose File > New > Labels. On the Labels tab, choose the database and table, insert the fields, pick the label brand and type, and click New Document. Click Synchronize Labels to copy changes from the first label to the rest, then print with File > Print as above.

Common problems

If your spreadsheet is missing from the Data Sources list or the Labels dialog, it has not been registered. Register it with File > Wizards > Address Data Source.

Finally, mail merge fields only become recipient data at print time. Until then the letter shows field names, not names and addresses.

When you need multi-part personalised output, LibreOffice Writer mail merge needs specific settings in Calc with precise writing and prompting in Writer. But with these fields in place, printing does the rest, saving countless steps with just a press of File > Print.

Filed under DocumentsArchive