VBA, MS Access MS Access в примерах

Экспорт Отчёта в PDF

'Сохранение отчета в PDF
'Saving a report to PDF
Dim sPath$
    sPath = "D:\temp\Report_01.pdf"
    DoCmd.OpenReport "DataTest", acViewPreview, , "RecIDAuto=1", acHidden
    DoCmd.OutputTo acOutputReport, "DataTest", acFormatPDF, sPath, False
    DoCmd.Close acReport, "DataTest"



Или так:

Dim sReportName$, sFilePath$
'Saving a report to PDF..
    sReportName = "Report Name"
    sFilePath = "D:\temp\ppt0000456.pdf"    
    DoCmd.OutputTo acOutputReport, sReportName, acFormatPDF, sFilePath, False
    MsgBox "File saved as: " & vbNewLine & sFilePath, vbInformation, "Report Exported as PDF"

Назад ToTop
L.E. 14.06.2023
Рейтинг@Mail.ru