primuspaul
Board Regular
- Joined
- Dec 23, 2015
- Messages
- 75
- Office Version
- 2021
- 2019
- Platform
- Windows
I need to batch fill a bunch (sometimes 1-2, other times 100-200) of PDF files with multiple pieces of data from an excel table. Each row on the excel table contains info for one of the PDFs so if I need to fill out 200 of a particular form, that excel file will have 200 rows and however many columns as there are fields on the form.
I have done this in the past with VBA. It was basically done by laying out fields linked via offset() to the table and each time it printed the document to PDF, it would add one to the offset, do until offset number reached number of rows. Then I had the same VB script batch execute a command line program that pasted a PDF file over a "background" (blank template of the form).
It worked, but the method is incredibly clunky, mostly because the process always involves guessing the location of fields and arranging/resizing fields on the excel sheet to match (often taking close to 100 attempts of printing to PDF print, merging, viewing, repeating). Often it's not even worth it unless I need hundreds of forms filled out.
I tried paste-linking in a word file (with the PDF as a watermark), but the formatting keeps resetting when the fields change regardless of whether I link unformatted or formatted text.
Is there a better way of doing this?
I have done this in the past with VBA. It was basically done by laying out fields linked via offset() to the table and each time it printed the document to PDF, it would add one to the offset, do until offset number reached number of rows. Then I had the same VB script batch execute a command line program that pasted a PDF file over a "background" (blank template of the form).
It worked, but the method is incredibly clunky, mostly because the process always involves guessing the location of fields and arranging/resizing fields on the excel sheet to match (often taking close to 100 attempts of printing to PDF print, merging, viewing, repeating). Often it's not even worth it unless I need hundreds of forms filled out.
I tried paste-linking in a word file (with the PDF as a watermark), but the formatting keeps resetting when the fields change regardless of whether I link unformatted or formatted text.
Is there a better way of doing this?