To get the most out of Page’s mail merge, link it with Numbers

by Tom Gorham on May 18, 2010

Tom Gorham

Tom Gorham

Mail merge was once best avoided and overshadowed by Microsoft’s effort, but it’s been improved and is now worth a second look.

If MacUser’s readers were to put together a list of Pages 09′s can’t-live-without features, I’d be prepared to give long odds on the words ‘mail merge’ being mentioned.

I may be guilty of exposing hideously misconceived prejudices here, but I have doubts that the core MacUser readership affords this feature the same degree of respect they might apply to Pages’ admittedly more glamorous selling points.

That’s a shame, because not only is a mail merge feature a useful design accessory for producing customised literature, but it’s also a great behind-the-scenes business feature. Let’s say you’re tracking income and expenses in a spreadsheet (given the dearth of decent desktop accounting applications nowadays, not an outlandish possibility), the ability to generate polished invoices based on spreadsheet data is a productivity boon.

But perhaps the real reason that few Pages owners have much to say about mail merge is because either they don’t know the feature exists or think it’s so insipid as to be not worth bothering about. I have some sympathy with this view, as that’s an attitude I held until this week.

In the past, my experience of merging word-processed documents had been limited to Microsoft Word. And say what you like about Word, when I last tried Pages’ similarly named feature, Microsoft’s effort was streets ahead. While Word could import and manipulate data from any number of sources – Excel files, user-created lists and FileMaker Pro databases – the version of Pages I first tried to mail merge with only imported data from a single source, Address Book, and even this was limp.

Nor could you include multiple instances of the same field on a page, which effectively rules out printing nicely designed labels in Pages. Microsoft Word could do this. In fact, so too could Pages’ predecessor, AppleWorks. To create mailing labels, you’ll get more functionality from Address Book itself, where you can choose from a number of mailing label types from the Style menu from the program’s Print window.

However, there are reasons to be more enthusiastic about mail merging now that Pages 09 works with data from iWorks’ Numbers spreadsheet, which opens the program to merging all sorts of data.

Setting up a merge between Pages and Numbers isn’t complicated, but it’s worth ensuring that the Numbers table from which you want to import data is correctly set up. For a start, it has to have one or more header columns. If it doesn’t, Pages simply balks when you try to import data.

You connect Pages to the spreadsheet table through the Merge tab under Pages’ Link Inspector. The Choose button now offers the choice of importing data from a Numbers document. In the resulting dialog box, you just select the table from which you’d like to import the source data.

To add merge fields, select the text in Pages that you’d like to replace with the content from your Numbers table, and in the Link Inspector select Add Merge Field from the pop-up list at the bottom of the window. The target text and the merge field will be listed in the Link Inspector, and you can continue adding merge fields and target names throughout the document.

That’s fine as far as it goes, but it still hardly qualifies as versatile. Most critically for me, there’s no obvious equivalent of Microsoft Word’s most useful merging feature: the way you can include merged text based on whether certain criteria is matched. Supposing, for example, you kept subscriber details in a spreadsheet and you only wanted to send a letter to those in a particular town or postcode. While there’s no way to do that in Pages, there’s a way to set up conditional merges: you just use Numbers instead.

The secret is to use Numbers 09′s excellent feature that lets you hide specific rows or columns. Hiding rows doesn’t delete them from the spreadsheet: it only makes them temporarily disappear from view. You can hide individual rows or columns manually through the drop-down menu on each header row or header column. More usefully, though, you can also set up rules to hide rows according to chosen criteria. And I discovered that when you set up a mail merge from a Numbers spreadsheet in Pages, hidden rows are ignored. (Perhaps that isn’t surprising, as when you paste a Numbers table into a Pages of Keynote document, the same thing happens.) That means that you can merge only the data you want by hiding rows.

To hide rows according to the criteria you set, you select the whole table in Numbers and click the Toolbar’s Reorganise button. In the second section of the ‘Reorganize my Table’ window, under the greyed-out ‘Show rows that match the following’, select the name of the header column by which you’d like to filter and choose the rule to be matched for the cell to appear in the table. There’s a big choice of criteria here: as well as criteria that can be used for text merges, some can apply calculations to field cells before determining whether they should appear. For example, you can choose to show only rows where the content of a cell is ‘above average’ of the other cells in that row. You then need to click the ‘+’ button to trigger the rule. You can also apply multiple conditions to build up a formidable conditional rule. The results of this set of filters are immediately displayed in the Numbers table – and you can always revert to the full display by clicking the ‘Reset’ button in the Reorganize Table window.

Back in Pages, once the link to the database has been set up and the relevant merge fields established, you only need to select Edit > Mail Merge and choose whether to send the merge to a printer or to a new document containing all the merged fields. As Pages lacks a preview mode, I’d recommend the latter option to check your merge has worked correctly.

Further, you don’t need to print your documents. You can also email them, although it requires a little bit of a workaround. You need to save the merged document as a PDF from the Print dialog. Open the resulting PDF in Preview, and, from its sidebar, drag the relevant thumbnails for each merge – whether one page or more – over an open email message window. In Snow Leopard, the dragged pages will be added as single PDF document attachment.

There are still weaknesses I can’t yet surmount in Pages – for example, I’d like to be able to import images, as Pages would make a great catalog tool. But even then, I’m pleased with what can be achieved through what originally looked like a limited feature.

For more breaking news and reviews, subscribe to MacUser magazine. We'll give you three issues for £1
  • Geezer

    You can use mail merge to pull in long chunks of text if you start your Numbers filed with an accented letter e.g. ‘é’. I am a lecturer and write grading reports for students in a Numbers spreadsheet using form entry on an iPad. I then have to include that feedback into official documentation.
    Easy just make a Numbers spreadsheet with pre defined drop downs for the grades and a large comment field. Add the ‘é’ character at the start of this filed and away you go through each student’s report. When its time to make the documentation, just do the mail merge and ‘boom’ it all works. Without the accented character, your text gets truncated. I believe Word/ Excel also truncates but I don’t know the workaround.
    Thanks for this article though, I din’t know the thumbnails from Preview to Mail trick, very useful..

Previous post:

Next post:

>