It's a shame not only Adobe sells a product and doesn't support the customers, but also doesn't offer enough documetaion on what they promis their software can do.
After days of trial and error, I end up to the following method. I'm not sure if it's the best way to do it, but in a world without documention, anything that works is correct.
The following code, creates a blank file, adds a page and saves it.
It's using Late Binding method.
Dim Ret As Long
Dim AddAfter As Long
Dim DocPageCount As Long
Dim AcroApp As Object
Dim ResultDoc As Object
Dim AddThisDoc As Object
Set ResultDoc = CreateObject("AcroExch.PDDoc")
Set AddThisDoc = CreateObject("AcroExch.PDDoc")
' Create a blank pdf
Ret = ResultDoc.Create()
' Add the first pdf
AddThisDoc.Open ("D:\File2.pdf")
If ResultDoc.InsertPages(AddAfter - 1, AddThisDoc, 0, AddThisDoc.GetNumPages(), True) = False Then
MsgBox "Failed to Add "
End If
AddAfter = AddAfter + AddThisDoc.GetNumPages()
AddThisDoc.Close
' Add second file
AddThisDoc.Open ("D:\File2.pdf")
DocPageCount = AddThisDoc.GetNumPages()
If ResultDoc.InsertPages(AddAfter - 1, AddThisDoc, 0, DocPageCount, True) = False Then
MsgBox "Failed to Add "
End If
' save result
If ResultDoc.Save(1, "D:\test.pdf") = False Then
MsgBox "Failed to save the file."
End If
ResultDoc.Close