vba 以编程方式执行 Access 2007 报告并将该报告导出为 PDF?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3602864/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Execute Access 2007 Report and Export that Report to PDF Programmatically?
提问by MattUebel
I have a great report in an Access 2007 Database and would like to automate the execution and exportation of that report. Is this possible and what would be your first guess at the method needed to pull it off?
我在 Access 2007 数据库中有一份很棒的报告,并希望自动执行和导出该报告。这是可能的,你对实现它所需的方法的第一个猜测是什么?
回答by HansUp
You should be able to automate using the DoCmd.OutputTo method. I think the PDF feature requires SP1 for A2007. Here's a simple example:
您应该能够使用 DoCmd.OutputTo 方法实现自动化。我认为 A2007 的 PDF 功能需要 SP1。这是一个简单的例子:
DoCmd.OutputTo acOutputReport,"rptFoo",acFormatPDF,"D:\Access\rptFoo.pdf"
Look at the MSDN page for more details: DoCmd.OutputTo Method
查看 MSDN 页面了解更多详情:DoCmd.OutputTo Method