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. (If Acrobat Pro is installed, its PDFMaker add-in does put a per-record merge button in Word's ribbon; the Acrobat mail merge post covers it, including the file-naming limit that keeps the macro below relevant.) Google Docs doesn't have mail merge built in at all; add-ons fill the gap and bring Google's quota limits with them. (We walk every route from a spreadsheet, email merges included, in the Google Sheets mail merge guide.) So there are three real routes: a macro if you work in Word, Autocrat if your data lives in Google Sheets, and SheetRender if you want separate files without building the merge yourself.
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 in Google Sheets and batches are modest.
- Design your template as a Google Docs document, with
<<placeholder>>tags where data goes. - In Google Sheets: 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 Google 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 (Google 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 SheetRender:
- Upload your spreadsheet (Excel, CSV, or connect Google Sheets).
- 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 Google Docs document, 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. Free is 50 documents a month, no card, with a "Made with SheetRender" footer. Paid plans start at $19 a month and drop the footer. If your data lives in Google Sheets and you'd rather stay there, the Google Sheets add-on runs the same flow from a sidebar.
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.
If the choice is among hosted tools, not Word versus Autocrat, use convert a spreadsheet to PDF automatically.
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. And if the letters are employment verifications, that post has the template and the roster columns ready to merge.