简体   繁体   English

尝试退出 Acrobat 对象时,创建和关闭 pdf 会产生错误

[英]Creating and closing pdf generates error when trying to exit Acrobat object

I am trying to create an instance of a pdf document and then close it.我正在尝试创建一个 pdf 文档的实例,然后将其关闭。

I added references in Tools->References.我在工具-> 参考中添加了参考。

I am getting error at the last two lines as highlighted.我在突出显示的最后两行出现错误。

Dim AcroApp As New Acrobat.AcroApp
Dim PartDocs() As Acrobat.CAcroPDDoc
.
.
.
If Not PartDocs(0) Is Nothing Then PartDocs(0).Close
Set PartDocs(0) = Nothing

'Quit Acrobat application
**AcroApp.Close
Set AcroApp = Nothing**

As I still cannot comment - have you tried this approach?由于我仍然无法发表评论-您是否尝试过这种方法?

AcroApp.Exit
Set AcroApp = Nothing

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:将VBA连接到Adobe Acrobat时出现“ ActiveX无法创建对象” - Error:' ActiveX Cannot Create Object' When Connecting VBA to Adobe Acrobat 尝试将PDF文件转换为文本文件时ActiveX无法创建对象错误 - ActiveX cannot create object error when trying to convert PDF file to text file 创建Internet Explorer对象会生成运行时错误'-2147467259(80004005)'自动化错误未指定的错误 - Creating Internet Explorer object generates Run-time error '-2147467259 (80004005)' Automation Error Unspecified Error 创建Outlook对象会生成-运行时错误'429':ActiveX组件无法创建对象 - Creating Outlook object generates - Run-time error '429': ActiveX component can't create object 在 Excel 应用程序中创建 Outlook 项目生成错误:“对象不支持此属性或方法” - Creating Outlook Item in Excel Application generates error: “Object doesn't support this property or method” 使用拆分创建数组会产生类型不匹配错误 - Creating array with Split generates Type Mismatch error 关闭文件时出错 - Error when closing file Excels尝试通过Python转换为PDF时显示错误 - Excels shows error when trying to convert to PDF through Python 复制单元格范围会生成对象定义错误 - Copying range of cells generates object defined error ListBox1.List生成对象定义的错误 - ListBox1.List generates Object defined error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM