Skip to main content
Participating Frequently
Sep 23, 2021 2:26 AM UTC
Question

"Access denied" error when attempting to open documents in Acrobat via interapplication communicatio

I've been trying to open a PDF in Acrobat via interapplication communication, by using the .Open() method of an AVDoc object created from the .GetAVDoc() method of an App object (after using .Close() to close a document that was previously open in the same AVDoc object). However, when I attempt to do this, Acrobat produces an "access denied" message. I am able to open the document directly from Acrobat without problem, and via the .Open() method of an AVDoc object created by Dispatch("AcroExch.AVDoc"), but I want to use a menu command on a large number of documents, so I need to automatically open documents attatched to an App object. The problem occurs with all PDFs.

This topic is closed to new replies. Start a new post to keep the conversation going.

4 replies

Legend
Sep 24, 2021 8:02 AM UTC

By the way, if your "large number" is more than about 100, I suggest you will find this is unworkable without restarting Acrobat often. Acrobat is an interactive tool with only very limited, low volume, automation.

Translate
Legend
Sep 23, 2021 8:05 AM UTC

Closing the AVDoc is the end of the AVDoc. You cannot use it to open another document. The AVDoc is not a container into which documents are opened, it is the document itself.

Translate
Participating Frequently
Sep 23, 2021 11:13 PM UTC

Then how come I can close one document and open another with an AVDoc object created via Dispatch("AcroExch.AVDoc")?

Translate
Legend
Sep 24, 2021 8:00 AM UTC

Make a new instance after closing the old one. From the documents

"Open
Opens a file. A new instance of AcroExch.AVDoc must be created for each displayed PDF file"

Translate