2013-06-26 55 views
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 

回答

0

沒關係我明白爲什麼PDF另存爲對話框正在顯示。您需要更改Print2Pdf軟件中的配置。它與實際的代碼本身無關。

相關問題