Word and Acrobat Mail Merge with field-based file names

I was asked to create certificates for several hundred people in such a way that the files would be readily identifiable. The challenge with this is that Mail Merge in MS Word (2016) doesn’t allow you to use a field name for the output, so you can’t create

  • bob.docx
  • nancy.docx
  • grace.docx

You can only create:

  • some-stem-1
  • some-stem-2
  • some-stem-3

Based on some Googling this is quite a common problem. Here’s how I solved it, and it’s a variation on what I learned here.

  • Create the Document in Word, in this case using the certificate as a background image
  • Use the Mail merge wizard with the Excel file data source
  • Add an invisible Heading 1 for the eventual file name using the fields I wanted as the file name stem, in this case “college”-“email”
  • Perform mail merge in Word. This should create a single file with a page (in my case) for each row of the spreadsheet
  • Separately Create the PDF. The trick kicks in here because each Heading 1 is converted to a top-level bookmark in Acrobat
  • In Acrobat -> Organize pages-> Split -> Using top-level bookmarks with the output option of “Use bookmark names for file names”

The result is a folder of individual files with custom names based on the bookmarks/headings.