Merge PDF's via Access VBA

Ajit Singh

Registered User.
Local time
Yesterday, 18:10
Joined
Jul 11, 2013
Messages
34
Am using below code for generating set of pdf files in a desired folder........similarly I have another code, which generates another set of pdf file in another folder.....Count and Filename is identical in both the folders and I need to merge the file names with identical names together....separate binder file would also work.......Can anybody help me with the resolution of this asap.


Private Sub Command14_Click()
Dim strDefaultPrinter As String
strDefaultPrinter = Application.Printer.DeviceName
Set Application.Printer = Application.Printers("Adobe PDF")
Dim rst As DAO.Recordset
Dim fullreportname, AJIT, CustomerID, ReportingMonth As String
Set rst = CurrentDb.OpenRecordset("UniqueCostCenters_E&C", dbOpenDynaset)
With rst
Do Until .EOF
CustomerID = !CostCenter
ReportingMonth = !Month
fullreportname = "SAP Line Item for " & ReportingMonth & "_" & CustomerID
AJIT = "SAP Line Item Report-YTD"
'Me.Combo12 = rst.Fields("CostCenter")

DoCmd.CopyObject , fullreportname, acReport, "SAP Line Item Report"
DoCmd.OpenReport fullreportname, , , "CostCenter='" & CustomerID & "'"
DoCmd.Close acReport, fullreportname, acSaveNo

''''Is it possible to append below report in above created report?

DoCmd.SetWarnings False
DoCmd.CopyObject , fullreportname, acReport, AJIT
DoCmd.OpenReport fullreportname, , , "CostCenter='" & CustomerID & "'"
DoCmd.Close acReport, fullreportname, acSaveNo

.MoveNext
DoCmd.DeleteObject acReport, fullreportname
Loop
.Close
End With
Set rst = Nothing
Set Application.Printer = Application.Printers(strDefaultPrinter)
End Sub
 
No need to pay for it, though. Find it free here (official freeware):

www.TechSpot.com

If you get a required file for AdobePDF.dll, just search your entire c:\ drive for it. I found it on Win7 here:

C:\Windows\System32\DriverStore\FileRepository\adobepdf.inf_amd64_neutral_70cb20a3417216e2\Amd64Vista
 
Thanks all for the speedy reponses but I was able to discover "Adobe Acrobat 10.0 Type Library" reference on my machine and code is for "Adobe Acrobat 7.0 Type Library"........is there any way I can move ahead with the Adobe Acrobat 10.0 Type Library????
 
Hello Ajit, in order to perform Merge; as sxschech has mentioned, you need the complete Pro version of Acrobat.
 

Users who are viewing this thread

Back
Top Bottom