title: Combine PDFs into one PDF file using Access VBA issue
body: <p>I am currently using this code to merger my Access reports that are printed out to .pdf. It has been working fine until recently and i am not sure why it is not merging my .pdf files. Could someone look at it and tell me what is wrong. My References is set to Adobe Acrobat 10.0 Type Library. Any help is greatly appreciated.</p>
  <pre><code>Dim Encl2, Encl2FN, Encl2Path, Encl3, Encl3FN, Encl3Path, Encl4, Encl4FN, Encl4Path As String
  Dim RPath, TempPath, TempPathEncl2, TempPathEncl3, TempPathEncl4 As String
  Dim UserPth, strfile, strFilePath As String
  Dim arrayFilePaths() As Variant
  Dim app As Acrobat.CAcroApp
  Dim primaryDoc As Acrobat.CAcroPDDoc
  Dim SourceDoc As Acrobat.CAcroPDDoc
  Dim OK
  Dim arrayIndex
  Dim numberOfPagesToInsert As String
  Dim numPages As Integer
  
  Encl2 = &quot;rpt_Delegation_Enclosure2&quot;
  Encl3 = &quot;rpt_Delegation_Enclosure3&quot;
  Encl4 = &quot;rpt_Delegation_Enclosure4&quot;
  
  Encl2FN = &quot;Enclosure2&quot; &amp; &quot;.pdf&quot;
  Encl3FN = &quot;Enclosure3&quot; &amp; &quot;.pdf&quot;
  Encl4FN = &quot;Enclosure4&quot; &amp; &quot;.pdf&quot;
  
  UserPth = Environ(&quot;USERPROFILE&quot;)
  TempPathEncl2 = UserPth &amp; &quot;\Desktop\&quot; &amp; Encl2FN
  TempPathEncl3 = UserPth &amp; &quot;\Desktop\&quot; &amp; Encl3FN
  TempPathEncl4 = UserPth &amp; &quot;\Desktop\&quot; &amp; Encl4FN
  strfile = &quot;SourceRpt&quot; &amp; &quot;.pdf&quot;
  strFilePath = UserPth &amp; &quot;\Desktop\&quot; &amp; strFile
  
  RPath = strFilePath
  
      Set app = CreateObject(&quot;AcroExch.App&quot;)
  
      arrayFilePaths = Array(RPath, TempPathEncl2, TempPathEncl3, TempPathEncl4)
  
      Set primaryDoc = CreateObject(&quot;AcroExch.PDDoc&quot;)
      OK = primaryDoc.Open(arrayFilePaths(0))
      Debug.Print &quot;PRIMARY DOC OPENED &amp; PDDOC SET: &quot; &amp; OK
              
      For arrayIndex = 1 To UBound(arrayFilePaths)
          numPages = primaryDoc.GetNumPages() - 1
  
          Set SourceDoc = CreateObject(&quot;AcroExch.PDDoc&quot;)
          OK = SourceDoc.Open(arrayFilePaths(arrayIndex))
          Debug.Print &quot;SOURCE DOC OPENED &amp; PDDOC SET: &quot; &amp; OK
  
          numberOfPagesToInsert = SourceDoc.GetNumPages
  
          OK = primaryDoc.InsertPages(numPages, SourceDoc, 0, numberOfPagesToInsert, False)
          Debug.Print &quot;PAGES INSERTED SUCCESSFULLY: &quot; &amp; OK
  
          OK = primaryDoc.Save(PDSaveFull, arrayFilePaths(0))
          Debug.Print &quot;PRIMARYDOC SAVED PROPERLY: &quot; &amp; OK
          
          Set SourceDoc = Nothing
      Next arrayIndex
  
      Set primaryDoc = Nothing
      app.Exit
      Set app = Nothing
  End Sub
  </code></pre>