logo
search
VBA & Macro Problems

How to Merge a Supplier PDF with an Access Report PDF Using VBA

Steven ParkerSteven Parker Oct 14, 2026 870 views

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.

How to Merge a Supplier PDF with an Access Report PDF Using VBA
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.
Before you start

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.

Solution 1Recommended

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.

1
Export the Access Report

Use the DoCmd.OutputTo method in your VBA code to generate the order-information report and save it as a temporary PDF file.

2
Locate the Supplier PDF

Write a VBA function that searches your predefined supplier folder for the quote PDF using its unique quote number.

3
Execute the Merge Command

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.

4
Securely Delete Temporary Files

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.

Company Approval: Always ensure you have administrative or security approval before automating emails and running background shell commands on a corporate network.
Free Microsoft Office alternative

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. 1. Open WPS PDF: Launch WPS Office and click on the 'PDF' tab from the main interface.
  2. 2. Select Merge PDF: Navigate to the toolkit or tools menu and click on the 'Merge PDF' feature.
  3. 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.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats.Built-in robust PDF toolkit to merge, split, edit, and sign documents seamlessly.Lightweight architecture ensures quick load times and smooth performance.Familiar user interface requires no learning curve for Microsoft Office users.
microsoft office alternative - wps office

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.