如何解决访问问题:OutputTo在Access 2007中不起作用
| 我已在Access 2010中使用此代码生成pdf文件 DoCmd.OutputTo acOutputReport,\“ Graph_report2 \”,\“。pdf \”,\“ C:\\ Graph_report2.pdf \”,True 它在Access 2010中工作正常,但是当我在Access 2007中打开我的Access数据库时,出现运行时错误2501,提示“'OutputTo操作已取消\',而不是打开pdf文件。 大问题!我该怎么办?请帮助解决方法
DoCmd.OutputTo acOutputReport,\"Graph_report2\",\".pdf\",\"C:\\Graph_report2.pdf\",True
应该:
DoCmd.OutputTo acOutputReport,acFormatPDF,True
抢
, 除了需要安装用于PDF输出的加载项然后启动Access 2007之外,我是否可以补充一下,http://www.microsoft.com/en-us/download/details.aspx?id = 9943
如果尝试将文件保存在不存在的目录中,也会弹出此错误。
这是PDF输出的功能:
Function PrintToPDF(SrcReport As String,DestPath As String,DestFile As String,ShowPdf As Boolean)
On Error GoTo PrintToPDF_Err
\'ScrReport = The report Name to output as PDF
\'DestPath = Destination path for PDF file e.g. C:/DatabaseReports/Financial/
\'DestFile = File name for the PDF file being created,but without the file extension,one can add date to it
\'Showpdf = launch pdf viwer and display this PDF output
DoCmd.OutputTo acOutputReport,SrcReport,\"PDFFormat(*.pdf)\",DestPath & DestFile & \".pdf\",ShowPdf,\"\",acExportQualityPrint
PrintToPDF_Exit:
Exit Function
PrintToPDF_Err:
MsgBox Error$
Resume PrintToPDF_Exit
End Function
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。