How to Split a Mail Merge into Separate PDF Files
By Josh ·
You have a spreadsheet with one row per person. You need one PDF per person: offer-letter-maria.pdf, offer-letter-david.pdf, not one long document with everyone stacked end to end.
Short answer: Word's mail merge can't produce separate files on its own. To get one PDF per row, you either run a short VBA macro that loops the merge and exports each record individually, use a Google Sheets add-on like Autocrat, or use a tool that outputs separate files natively. The macro is free and takes about ten minutes to set up. Steps for all three are below.
Why the "normal" way doesn't work
Word's mail merge merges to a single document or straight to a printer. Every record, one after another, in one file. Google Docs doesn't have mail merge built in at all; add-ons fill the gap and bring Google's quota limits with them. So there are three real routes: a macro if you work in Word, an add-on if your data lives in Google Sheets, and a tool built around separate files. That last one is ours, and I'll flag it when we get there.
Option 1: Word + a VBA macro
Best when your batches are small and everything already lives in Word. (Windows in practice: Word for Mac has VBA too, but its sandbox blocks writing files where the macro needs to, so Mac users should go straight to Option 2.)
- Set up your mail merge as usual (Mailings > Start Mail Merge, select your recipient list, insert merge fields) and preview a record to confirm it looks right.
- Save the document somewhere. The macro writes PDFs next to it, so an unsaved document has nowhere to put them.
- Press
Alt+F11to open the VBA editor, then Insert > Module, and paste the loop below, which exports one record at a time. One design note before you run it: most versions of this macro floating around loop to.DataSource.RecordCount, and on several data source types, including some Excel and CSV connections, Word reports that count as -1. The loop runs zero times and looks like it succeeded. This one jumps to the last record and reads back its position instead:Sub MergeToSeparatePDFs() Dim mainDoc As Document, rec As Long, total As Long Set mainDoc = ActiveDocument With mainDoc.MailMerge ' Word reports -1 for some data sources, so count from the last record .DataSource.ActiveRecord = wdLastRecord total = .DataSource.ActiveRecord For rec = 1 To total .DataSource.FirstRecord = rec .DataSource.LastRecord = rec .Destination = wdSendToNewDocument .Execute Pause:=False .DataSource.ActiveRecord = rec ActiveDocument.ExportAsFixedFormat _ OutputFileName:=mainDoc.Path & Application.PathSeparator & _ .DataSource.DataFields("Name").Value & ".pdf", _ ExportFormat:=wdExportFormatPDF ActiveDocument.Close SaveChanges:=False Next rec End With End Sub - Change
"Name"to whichever column should become the filename, then run it withF5. One PDF per record lands next to your Word document.
Expect friction anyway. A / or : anywhere in the filename column kills the export mid-run, and a date column is the classic way to get one. Blank or duplicate values mean empty names and silent overwrites: the second Maria replaces the first, and nothing tells you. Corporate macro policy blocks the whole approach at plenty of workplaces. Within those limits, the macro is free, works offline, and for an occasional batch it does the job.
Option 2: Google Docs + Autocrat
Best when your data is a Google Sheet and batches are modest.
- Design your template as a Google Doc, with
<<placeholder>>tags where data goes. - In your Google Sheet: Extensions > Add-ons > Get add-ons, install Autocrat.
- Launch Autocrat, create a job, map each
<<tag>>to a column, and pick PDF as the file type. Make sure the job is set to multiple output, one file per row; single output mode is the one that glues every record into one document. - Run the job. Files land in the Drive folder you chose, named by a formula you control. You can also trigger jobs on form submissions or on a schedule.
The catch is Apps Script. Add-ons run on it, and Google's ceilings are specific: a single run is killed at six minutes, and a free Gmail account gets 250 created documents and 90 minutes of trigger runtime a day (Workspace accounts raise the daily caps; nothing raises the six-minute one). A big or image-heavy batch dies partway with "Exceeded maximum execution time" or "Service invoked too many times"; we wrote up what those errors mean and how to fix them separately. For a roster of a few dozen names run a few times a year, Autocrat is the right free tool.
Option 3: A tool built for separate files
Best when the batch recurs or the output has to look designed. This is the category SheetRender is in, so grain of salt, but the workflow difference is real:
- Upload your spreadsheet (Excel, CSV, or connect a Google Sheet).
- Upload one finished example document. A PDF is the reliable path; a clean screenshot usually works too.
- Check the template and field mapping SheetRender proposes from your example, then generate. Download the batch as a zip of separate PDFs, each named from your columns, or email every file to a matching address column.
Step 2 is the difference. In Options 1 and 2 you build the template yourself, merge fields in Word or <<tags>> in a Doc, and keep it working as columns change. Here the template comes from the finished example, and your job is to correct the mapping where it guessed wrong.
Rendering runs on our infrastructure rather than your Google account, so Apps Script quotas never enter the picture. The trade-off is that it's a hosted product, not a script you own. The free tier covers 50 documents a month, no card required, and adds a small "Made with SheetRender" footer to each one; paid plans start at $19 a month and drop the footer.
Which one should you pick?
- Small batches, once in a while, everything already in Word: the macro.
- Google-native, modest batches, comfortable maintaining placeholder tags: Autocrat.
- Recurring batches, bigger rosters, or output that needs to look designed rather than merged: SheetRender.
And if the files you're merging are certificates, the options are a little different (Canva is in the running, for one). We compare them in the bulk certificate guide.