Merging PDF docs through VBA

jpsimmon

New Member
Joined
Apr 9, 2015
Messages
28
I have code I am using to merge 2 different PDF's, if "gPDDoc1" has 1 page and "GpDDoc2" has 20 pages. I am not familiar with the page ordering of my resulting merged PDF:
Rich (BB code):
mergefile = gPDDoc1.InsertPages(1, gPDDoc2, 0, 1, 0)

The full code I am using is here:
Rich (BB code):
Sub Merge()

Dim gPDDoc1 As AcroPDDoc
Dim gPDDoc2 As AcroPDDoc
'Dim gPDDOC3 As AcroPDDoc

Set gPDDoc1 = CreateObject("AcroExch.PDDoc")
Set gPDDoc2 = CreateObject("AcroExch.PDDoc")
'Set gPDDOC3 = CreateObject("AcroExch.PDDoc")

chk1 = gPDDoc1.Open("S:\FOLDER1\Title Page.pdf")
chk2 = gPDDoc2.Open("S:\FOLDER2\Full Doc.pdf")
'chk3 = gPDDOC3.Open("C:\test\test3.pdf")

mergefile = gPDDoc1.InsertPages(1, gPDDoc2, 0, 1, 0)
'mergefile = gPDDoc1.InsertPages(1, gPDDOC3, 0, 1, 0)

savemergefile = gPDDoc1.Save(1, "S:\FINALFolder\MERGED.pdf")
End Sub
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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