Skip to main content
April 26, 2019
Question

merge documents via VBA

  • April 26, 2019
  • 2 replies
  • 1333 views

I've been using a 3rd party tool to merge documents from an Access database for several years.  My client was using Acrobat 9.xx but recently upgraded to Acrobat 2017 and the code no longer works.  This process merges as many as 100 pdf files, one at a time, into a master report for my client is critical as they perform this action several times a quarter.

As I said, we have been using a 3rd party tool and I basically shell out a simple command to merge two documents into a third:

pdftk C:\...\Budget\2019-03-06-09-51.pdf C:\...\Budget\002.pdf cat output C:\...\Budget\Temp.pdf

Can I do this with Acrobat 2017?

This topic has been closed for replies.

2 replies

Bernd Alheit
Community Expert
Community Expert
April 26, 2019

Why can't you use pdftk?

April 26, 2019

User has been using Acrobat 9.xx and the code has been working fine, but when they installed Acrobat 2017, the code locks up on the shell command.

I tried to contact the author of the PDFtk, but received no response, so I'm looking for alternatives.  Since they own a copy of Acrobat 2017, I thought I would try here first.

Bernd Alheit
Community Expert
Community Expert
April 29, 2019

pdftk will work with or without Adobe Acrobat.

Karl Heinz  Kremer
Community Expert
Community Expert
April 26, 2019

Are you doing this on a server, or in a server like environment? This means, can somebody without a license to Acrobat potentially use this functionality? If that's the case, then you cannot use Acrobat for this.

If that's not true, then Acrobat is an option. How to you determine which files need to be merged? You could potentially kick off the merge from within Access using VBA. Take a look here for some ideas about how this would look:

Adobe Acrobat and VBA - An Introduction - KHKonsulting LLC

April 26, 2019

@Karl,

No, not in a server environment, Acrobat 2017 will be installed on the same computer as is running the Access application.

Thanks for the code, I'll get back to you once I've got a test environment setup and can test this out.

I would have preferred a single command line, but I can deal with adding a code module to what I already have.

Dale