I have a command button which prints a series of reports to CutePDF. This work fine but each time a pdf file is created, a box appears asking me where I want to save it. Is there a way of adding a line to my code which does this automatically?
The code I have looks like this:
Best Regards
John
The code I have looks like this:
Code:
Private Sub CreatePDF_Click()
On Error GoTo Err_CreatePDF_Click
Dim prtDefault As Printer
Set Application.Printer = Application.Printers("CutePDF Writer")
Set prtDefault = Application.Printer
Dim stDocName1 As String
Dim stDocName2 As String
Dim stDocName3 As String
stDocName1 = "RptRobertsInd"
stDocName2 = "RptRobertsTeam"
stDocName3 = "RptRoupellInd"
DoCmd.OpenReport stDocName1, acNormal
DoCmd.OpenReport stDocName2, acNormal
DoCmd.OpenReport stDocName3, acNormal
Set Application.Printer = Application.Printers("HP Laserjet 1020")
Set prtDefault = Application.Printer
Exit_CreatePDF_Click:
Exit Sub
Err_CreatePDF_Click:
MsgBox Err.Description
Resume Exit_CreatePDF_Click
End Sub
Best Regards
John