0
我目前正在使用Microsoft Access 2010.是否有任何方法可以消除SaveAs對話框?運行命令後,它會顯示,然後當您單擊取消時,它會將報告打印到正確的位置。每次都會顯示一個細微差別。OutPutTo消除SaveAs對話框
Public Sub PrintReportToPDF(ByRef strReport As String, ByRef FilePathandFileName As String)
On Error GoTo ErrHandler
DoCmd.SetWarnings False
DoCmd.OpenReport strReport, acViewNormal
DoCmd.OutputTo acOutputReport, strReport, acFormatPDF,
FilePathandFileName & ".pdf", False, "", 0, acExportQualityPrint
ExitHere:
DoCmd.SetWarnings True
Exit Function
ErrHandler:
MsgBox Err.Description
Resume ExitHere
End Sub