Yes I am still in trouble and need help!
Code:
Dim AcroApp As Acrobat.CAcroApp
Dim Part1Document As Acrobat.CAcroPDDoc
Dim Part2Document As Acrobat.CAcroPDDoc
Dim numPages As Integer
Set AcroApp = CreateObject("AcroExch.App")
Set Part1Document = CreateObject("AcroExch.PDDoc")
Set Part2Document = CreateObject("AcroExch.PDDoc")
Part1Document.Open ("c:\MPI1.pdf")
Part2Document.Open ("C:\MPI2.pdf")
' Insert the pages of Part2 after the end of Part1
numPages = Part1Document.GetNumPages()
MsgBox numPages
If Part1Document.InsertPages(numPages - 1, Part2Document, 0, Part2Document.GetNumPages(), True) = False Then
MsgBox "Cannot insert pages"
End If
If Part1Document.Save(PDSaveFull, "C:\MergedFile.pdf") = False Then
MsgBox "Cannot save the modified document"
End If
Part1Document.Close
Part2Document.Close
AcroApp.Exit
Set AcroApp = Nothing
Set Part1Document = Nothing
Set Part2Document = Nothing
I installed Adobe Trial and the libraries seem to load properly the code doesn't crash, but it says "-1" for number of pages... when in fact "MPI1.pdf" has 2 pages.