Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Then how come I can close one document and open another with an AVDoc object created via Dispatch("AcroExch.AVDoc")?
Copy link to clipboard
Copied
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"
Copy link to clipboard
Copied
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.