Het draadje heeft deels mijn vraag beantwoord. Een collega heeft mij echter verder geholpen met het volgende. Het is nu opgelost.
Stap 1 maak een macro1, deze bevat de volgende regel:
(Actie) (Argument)
ProcedureUitvoeren PrintnaarPDF ("adres")
Maar een vba module Module1 met de volgende code:
Option Compare Database
Option Explicit
Function PrintnaarPDF(SrcFile As String)
On Error GoTo PrintToPDF_Err
Dim DestPath As String 'DestPath = doel path for PDF file
Dim DestFile As String 'DestFile = doel file name for PDF file
'Saves the file to the desktop of the current user
DestPath = "C:\Documents\" ' & Environ("USERNAME") & "\Desktop\"
'Formats the file name like this: "YYYY-MM-DD-ReportNameHere.pdf"
DestFile = DestPath & Year(Now) & "-" & Month(Now) & "-" & Day(Now) & "-" & SrcFile
DoCmd.OpenReport SrcFile, acViewPreview, , ""
DoCmd.OutputTo acOutputReport, "", acFormatPDF, DestFile + ".pdf", False, "", 0, acExportQualityPrint
DoCmd.Close
PrintToPDF_Exit:
Exit Function
PrintToPDF_Err:
MsgBox Error$
Resume PrintToPDF_Exit
End Function