Jim Avera (jim.avera [at] gmail.com)
Last updated Fri Jan 26 15:45:22 2024
Let's get this out of the way right now: The procedure is horrible for non-technical users. With Open/Libre Office you get fabulously more than you pay for, but that does not include a specialized application for printing labels from a mailing list. Instead, a combination of low-level features give us what we need.
On Windows or Mac, download Libre Office here.
Most Linux distributions now come with Libre Office 7.x. On an ancient Ubuntu (e.g. 12.04) you can use a special repository like this:
sudo apt-get remove 'libreoffice*'
sudo add-apt-repository ppa:libreoffice/ppa # once only
sudo apt-get update
sudo apt-get install libreoffice
The "mail-merge" machinery only works with data from a database; it can not read a spreadsheet directly. You must manually create a separate "database" file to serve as a conduit. This "database" won't contain any data, but will obtain data from the spreadsheet when needed:
The remaining steps can be done after closing and re-opening the mail-merge document.
Note: Edit only the first label on the page at the upper left, then click the floating
button to copy your changes to the other label positions. If you don't see the Synchronize Labels button, look in the extreme corners of your screen; it can be moved wherever convenient.When editing label text, be sure to click inside the label border (when the cursor has an I-beam shape). If you click the border itself then the entire frame object will be selected, indicated by colored resize handles. You don't want to change the frame in any way, so if this happens click outside the page to de-select the frame. If you unintentionally change something, Control-Z will un-do the most recent change.
Note: The field names which you're about to insert may be too long to display in the label box. To make editing easier, it may help to temporarily apply a very small font size such as 6 pt to avoid line-wraps (try Control-A to select all paragraphs before changing the font size). Then use the "zoom" control at the lower-right corner to magnify the display.
Insert appropriate spaces and comma between fields to form a proper postal address. The result might look like this:
db.Sheet1.FIRST NAME db.Sheet1.LAST NAME¶ db.Sheet1.ADDRESS1¶ db.Sheet1.ADDRESS2¶ db.Sheet1.CITY, db.Sheet1.STATE db.Sheet1.ZIPClick the floating button to update other label positions.
Note: If the database fields were previously inserted, just insert paragraph breaks and spaces etc. between the existing fields as needed. Any LINE BREAKS (indicated by ↵ left-arrow symbols) must be deleted; lines should be broken only by starting a new paragraph. Don't be confused by wrapped long lines -- if you don't see a ↵ symbol then there is no line-break present.
To delete a LINE BREAK, place the cursor immediately after it and press your Delete key.
While editing, a special Next record token may have been automatically inserted after the last db field reference; be sure to not insert anything after it. See "Trouble Shooting" if this token is missing or gets deleted or mis-placed.
In the example above "ADDRESS2" might sometimes be empty; in that case we want to to avoid inserting a blank line in the output. To accomplish this feat, the paragraph containing db.Sheet1.ADDRESS2 should be conditionally hidden if the ADDRESS2 data field is empty for a particular label:
Drag the "ADDRESS2" column header from the Data Sources area to the "Condition" field in the Fields dialog (
to display Data Sources). Then insert an exclamation point in front of the resulting database reference. You should end up with something like this:
![db.Sheet1.ADDRESS2]
You should see Hidden Paragraph inserted into the label (visible only with ).
Now you have a mail-merge document which contains one page of labels, with database-field references where the actual data will be plugged in.
If you export to PDF instead, be sure to un-select "shrink to fit" or other scaling options when using it to print labels.
Also make sure there are no hard line breaks; a new line should be started only by starting a new paragraph. To verify this, use
and look for paragraph Pilcrows (¶) and verify that no line-break symbols (↵) are present.To restore the "next record" token:
It's in a separate small window which can appear anywhere on your screen, and might be hidden when the document doesn't have input focus. Try minimizing or closing all other windows on your screen; The window with the button might be shown on your task bar (clicking it will make it visible on the screen).
Note: When the mail-merge file is first created with , the "Synchronize contents" option must be selected on the Options tab. It it wasn't, you'll have to re-create the file from scratch.To fix the database file (db.odb in our example), open it and use
to change the path to the spreadsheet document. Use to verify the path.To fix the mail-merge file (mailinglist_mmerge.odt in our example), open it and do
and then browse to find the database file. It should then appear in the "Available Databases" panel. Click the triangle to view the sheets and select "Sheet1" (or as appropriate). Click .
This guide was originally developed using Libre Office 4.0.2.2 on Ubuntu 12.04, and re-tested using Libre Office 6.4.8.0 on Ubuntu 23.04.
Relevant Open Office documentation is here.