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
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.