These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Automation error - No document is currently open in the Acrobat Viewer

pcurt1s
Registered: Jan 19 2010
Posts: 6

Hello
We have a Visual Basic application that we use for automating tasks in Acrobat on a batch of files. This application calls a folder level javascript to perform most of the tasks and is invoked via an application menu item (to get around some of the security restrictions). This application runs fine in Acrobat 7. Recently we upgraded to Acrobat 9 and the application doesn’t work any more. The error that is being generated is

No document is currently open in the Acrobat Viewer

I have isolated the problem down to the piece of code that accesses the fields object of the AFormAut.App object. We use the fields object for executing the JavaScript methods. The FormsAutomation sample application that comes with version 9 of the SDK generates the same exception. I have seen references to this problem on various forums but there can’t find a definitive answer.

avDoc = CreateObject("AcroExch.AVDoc")
Dim file As String = System.Windows.Forms.Application.StartupPath & "\..\..\..\..\TestFiles\FormsAutomation.pdf"

bOK = avDoc.Open(file, "Forms Automation Demo")

'If everything was OK opening the PDF, we now instantiate the Forms
'Automation object.

If (bOK) Then
formApp = CreateObject("AFormAut.App")
acroForm = formApp.Fields
Else
System.Runtime.InteropServices.Marshal.ReleaseComObject(avDoc)
avDoc = Nothing
MsgBox("Failed to open PDF Document. Aborting...")
End
End If

To get around the problem I have to display the document that is currently being processed. This doesn’t seem correct as we don’t an acrobat window open when our application is processing a batch of files. Has this method of automation been removed from Acrobat 9 deliberately or is it a bug?

BTW I am not sure if this is the corrent forum to post this question. If there is a more appropriate forum for this query can someone point me in the right direction.

Any help would be greatly appreciated.
Thanks
Paul

My Product Information:
Acrobat Pro 9.2, Windows
elizas81
Registered: Jan 15 2010
Posts: 4
hi,
Though i am a non-technical person, i found your post very informative.A software developer of my company has designed a tips section on Automation error.Please go through this.

http://www.mindfiresolutions.com/Productivity-Tips-92.php

Hope it will be helpful.

Cheers,
Eliza

Mindfire: India's Only Company to be both Apple Premier & Microsoft Gold certified.

zmin2001
Registered: Oct 30 2009
Posts: 12
We use C++ and Acrobat V9.1.3. It worked fine until recently when our system admin installed a security patch and Acrobat Reader 9.3 upgrade. Now, we are not able to get form.fields interface any more (with the same No document... error). I suspect it's to do with the security patch but not sure what. Our system admin can't revert the changes.
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Have contacted Adobe Acrobat support?

They may have a setting that will allow access like 'disclosed' or it might take a 'trusted function' and the 'privileged' method.

George Kaiser