SheetRender Blog

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.

Can Word's mail merge save each record as its own file? Not 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.

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.) That leaves 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.

Save each record as a PDF with a Word VBA macro

Best when your batches are small and everything already lives in Word. This is a Windows route: Word for Mac has VBA too, but its sandbox blocks writing files where the macro needs to, so Mac users should go straight to Autocrat below.

  1. 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.
  2. Save the document somewhere. The macro writes PDFs next to it, so an unsaved document has nowhere to put them.
  3. Press Alt+F11 to 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
  4. Change "Name" to whichever column should become the filename, then run it with F5. 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 and works offline, and for an occasional batch it does the job.

Separate PDFs from Google Docs with Autocrat

If your data is already in Google Sheets and the batches are modest, start here.

  1. Design your template as a Google Docs document, with <<placeholder>> tags where data goes.
  2. In Google Sheets: Extensions > Add-ons > Get add-ons, install Autocrat.
  3. 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.
  4. 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.

Autocrat's limits come from Apps Script, which every Sheets add-on runs on. 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.

A tool that outputs one file per row

Best when the batch recurs or the output has to look designed. This one is ours, SheetRender, and the steps are:

  1. Upload your spreadsheet (Excel, CSV, or connect Google Sheets).
  2. Upload one finished example document. A PDF is the reliable path; a clean screenshot usually works too.
  3. 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. With the macro or Autocrat 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; the plan's monthly cap replaces them. The other side of that is where your rows go. We render the whole sheet on our servers, and Anthropic gets the example and a few sample rows when the template is built. Without a card you can split up to 50 documents a month, each with a "Made with SheetRender" footer. The first paid plan is $19 a month, which removes the footer and takes the cap to 1,500. 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 you have ruled out Word and Autocrat and are choosing among hosted tools, 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. For a nonprofit's January run, the donation receipt template covers the IRS wording the letter needs before you merge it.

Ready to turn every row into its own polished PDF?

Free plan · No credit card required