Combining different pdfs

kuopan

New Member
Joined
Feb 6, 2015
Messages
1
Is it possible to create a macro to combine various pdf files into one? I have Adobe Acrobat Pro DC 2021.

In short, we have several different pds files. For simplicity call it 1.pdf, 2.pdf, 3.pdf, 4.pdf.

Is it possible to create different buttons to combine different pdf files? i.e. Button A would combine 1.pdf & 2.pdf, Button B would combine 3 & 4, Button C would combine 1 & 4, etc.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
See if you can adapt the code at Combine multiple PDF files with VBA

I would change the code to a Sub/Function which accepts 3 arguments: input pdf 1, input pdf 2, output pdf, and then call it with appropriate arguments from the button click macros.

A correction is needed because the code uses late binding of the Acrobat library. Change this line:
VBA Code:
PDDocDestination.Save Acrobat.PDSaveFlags.PDSaveFull, PDFfiles(i, 1) & PDFfiles(i, 3)
to:
VBA Code:
PDDocDestination.Save 1, PDFfiles(i, 1) & PDFfiles(i, 3)
 
Upvote 0

Forum statistics

Threads
1,215,408
Messages
6,124,727
Members
449,185
Latest member
ekrause77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top