How to Merge a Supplier PDF with an Access Report PDF Using VBA
Question details
The user wants to combine an Access-generated order report PDF with a separately stored supplier quote PDF into a single document using VBA, and then email the combined file.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Automating the workflow of generating an order report in Access and combining it with a specific supplier's quote PDF before sending it out via email.
- Observed behavior
- Microsoft Access and VBA do not natively support editing or merging PDF files, preventing a direct code-only approach without external tools.
Verify that you have the exact file paths for both the generated Access report PDF and the supplier quote PDF, and confirm that your corporate security policies permit executing external command-line utilities via VBA.
Use an External PDF Utility via VBA Shell
Since VBA cannot merge PDFs natively, you can use the VBA Shell command to call a trusted command-line tool or external PDF library to combine the files.
This method requires a third-party application like PDFtk or a robust PDF API installed on your system. By passing the file paths to the utility through VBA, you can seamlessly combine documents in the background.
Use the DoCmd.OutputTo method in your VBA code to generate the order-information report and save it as a temporary PDF file.
Write a VBA function that searches your predefined supplier folder for the quote PDF using its unique quote number.
Use the VBA Shell function to trigger the command-line PDF utility, passing the file paths of the Access report PDF and the supplier quote PDF to output a single, merged document.
After the merge is validated and the email is sent, use the VBA Kill command to delete the temporary Access report PDF and the combined PDF to keep your directory clean.
Send PDFs as Separate Email Attachments
A simpler, native alternative that bypasses the need for third-party PDF merging utilities by attaching both files individually to the same email.
Easily Manage and Merge PDFs with WPS Office
Automating PDF merges in Microsoft Access requires complex VBA coding and external software. If you need a more straightforward way to manage, edit, and combine PDFs manually without programming, WPS Office provides built-in PDF tools alongside its powerful suite of productivity apps.
- 1. Open WPS PDF: Launch WPS Office and click on the 'PDF' tab from the main interface.
- 2. Select Merge PDF: Navigate to the toolkit or tools menu and click on the 'Merge PDF' feature.
- 3. Combine Files: Add both your generated order report and the supplier's quote PDF, arrange their order, and click 'Merge' to create a single document instantly.

Frequently Asked Questions
Why can't Microsoft Access merge PDF files natively using VBA?
Microsoft Access and its built-in VBA environment do not contain the native libraries required to parse and manipulate PDF file structures. While you can output a file to PDF, combining existing PDFs requires specialized PDF editing software or command-line tools.
How do I export an Access report to a PDF format in VBA?
You can use the DoCmd.OutputTo method in VBA. Set the object type to acOutputReport, name your report, set the output format to acFormatPDF, and provide the destination file path where the PDF will be saved.
What is the most reliable external tool to merge PDFs via VBA?
Many developers use command-line utilities like PDFtk (PDF Toolkit) or Ghostscript because they are easy to trigger silently using the VBA Shell command. Adobe Acrobat API can also be used if the full version of Adobe Acrobat is installed on the machine.
How do I send an email with attachments using VBA?
By referencing the Microsoft Outlook Object Library, you can create an Outlook.Application instance, generate a MailItem, define the recipient and subject, and use the .Attachments.Add method with the specific file paths to attach your PDFs before calling the .Send method.




