Skip to main content
azizrasul
Participant
May 24, 2018
Answered

Merging 2 pdf files using VBA

  • May 24, 2018
  • 3 replies
  • 6889 views

Hi, I have two (win2pdf) pdf files, call them pdf1.pdf and pdf2.pdf. I want to add the first page of pdf2.pdf to pdf1.pdf. I want to use MS Excel VBA to automate this. I copied some code from another forum but get errors straight away on variable declarations i.e.

Dim PartDocs() As Acrobat.CAcroPDDoc

Not sure what version of Acrobat I have and whether as a result referencing the correct Tools|Reference value.

Can't see Acrobat in the tools|reference.

Any help would be appreciated.

Thanks

Aziz

This topic has been closed for replies.
Correct answer Karl Heinz Kremer

You need to know what version of Acrobat you have. The best way to tell is by looking at the About screen (in the "Help" menu). What does it report? If you only have the free Adobe Reader, you are out of luck. If you do have Adobe Acrobat (either Standard or Pro), chances are that you did not include the reference to the TLB in your project. Take a look here for some information about how to create a small project: Adobe Acrobat and VBA - An Introduction - KHKonsulting LLC ​This post is a few years old and a bit dated, but you should still be able to follow along with your versions of Acrobat and Excel.

3 replies

azizrasul
azizrasulAuthor
Participant
May 25, 2018

I only have the basic version of Acrobat which explains why "Acrobat" doesn't appear in the list of Tools|References.

Thanks for pointing me in the right direction Karl.

Karl Heinz  Kremer
Community Expert
Karl Heinz KremerCommunity ExpertCorrect answer
Community Expert
May 24, 2018

You need to know what version of Acrobat you have. The best way to tell is by looking at the About screen (in the "Help" menu). What does it report? If you only have the free Adobe Reader, you are out of luck. If you do have Adobe Acrobat (either Standard or Pro), chances are that you did not include the reference to the TLB in your project. Take a look here for some information about how to create a small project: Adobe Acrobat and VBA - An Introduction - KHKonsulting LLC ​This post is a few years old and a bit dated, but you should still be able to follow along with your versions of Acrobat and Excel.

kglad
Community Expert
Community Expert
May 24, 2018