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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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,214,822
Messages
6,121,770
Members
449,049
Latest member
greyangel23

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