successnax.blogg.se

How to combine pdf files adobe acrobat 2015
How to combine pdf files adobe acrobat 2015











how to combine pdf files adobe acrobat 2015

  • Combined a series of pdf files, located in the same folder of the workbook containing the procedure.
  • This is my understanding of your question: StrFile = Dir(inputDirectoryToScanForFile & "*.pdf")Ĭode that takes a primary file and inserts other pdfs into that file: Sub main()ĪrrayFilePaths = Array("C:\Users\Evan\Desktop\PAGE1.pdf", _ InputDirectoryToScanForFile = "C:\Users\Evan\Desktop\New Folder\" PrimaryFile = "C:\Users\Evan\Desktop\myPDf.Pdf"

    how to combine pdf files adobe acrobat 2015

    Sub main()ĭim inputDirectoryToScanForFile As String These are the pathways later used in the adobe API calls to insert pdf into your primary. The loop in this code will add the pathway of every pdf file in that folder to your collection. Then assign the folder pathway of the folder with the pdf files that you would like to see inserted into your primary doc to inputDirectoryToScanForFile. The first file in the collection would be the file that you are inserting into, same as in first example. You can use something like below to generate the collection of documents to be inserted into your primary doc. I used this resource re method referencesĮDIT: Swapping the array for auto generated (mostly, the primary pdf still set by user) list of pathways to pdfs that you want to insert into the primary pdf) You need to have adobe acrobat installed / operational. OK = primaryDoc.Save(PDSaveFull, arrayFilePaths(0))ĭebug.Print "PRIMARYDOC SAVED PROPERLY: " & OK OK = primaryDoc.InsertPages(numPages, sourceDoc, 0, numberOfPagesToInsert, False)ĭebug.Print "PAGES INSERTED SUCCESSFULLY: " & OK NumberOfPagesToInsert = sourceDoc.GetNumPages OK = sourceDoc.Open(arrayFilePaths(arrayIndex))ĭebug.Print "SOURCE DOC OPENED & PDDOC SET: " & OK Set sourceDoc = CreateObject("AcroExch.PDDoc") Set primaryDoc = CreateObject("AcroExch.PDDoc")ĭebug.Print "PRIMARY DOC OPENED & PDDOC SET: " & OKįor arrayIndex = 1 To UBound(arrayFilePaths)

    how to combine pdf files adobe acrobat 2015

    If objCAcroPDDocDestination.InsertPages(objCAcroPDDocDestination.GetNumPages - 1, objCAcroPDDocSource, 0, objCAcroPDDocSource.GetNumPages, 0) Then ObjCAcroPDDocSource.Open ThisWorkbook.Path & "pathwithpdfs" & PDFfileName

    how to combine pdf files adobe acrobat 2015

    'Open the source document that will be added to the destination PDFfileName = Dir(ThisWorkbook.Path & "firstpdf" & n & ".pdf") I get no error msg but perhaps I am missing parts.Īny help would be appreciated. I have tried something like, but cannot seem to get it to work. I would like to not use a plug in tool and have tried with acrobat api below. I am trying to combine PDF's into one single pdf with the use of vba.













    How to combine pdf files adobe acrobat 2015