Hi all,
I found the below code:
Sub Button1_Click()
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:\temp\Part1.pdf")
Part2Document.Open ("C:\temp\Part2.pdf")
' Insert the pages of Part2 after the end of Part1
numPages = Part1Document.GetNumPages()
If Part1Document.InsertPages(numPages - 1, Part2Document,
0, Part2Document.GetNumPages(), True) = False Then
MsgBox "Cannot insert pages"
End If
If Part1Document.Save(PDSaveFull, "C:\temp\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
MsgBox "Done"
End Sub
on this link:
http://khkonsulting.com/2009/03/adob...-introduction/
I need to adjust it to get the path of the file from excel sheet, starting at row 2 and down. It is possible that it will have only a few or a lot and with different names.
how to create a loop that will set the part 1, part 2 and so on depending on how many files there are in the folder and subfolders.
and, the maybe harder part would be to add also the names of the files as bookmarks in the merged pdf file.
greetings.
Bookmarks