How can one open Adobe Reader with VBScript?

Geoffrey picture Geoffrey · Jul 21, 2010 · Viewed 17.1k times · Source

I want to programmatically fill in some fields in a form in PDF format.

I tried this code:

Set objAdobe = CreateObject("AcrobatReader.Application")
objAdobe.Visible = True 

I get the "ActiceX component can't create object" error.

Answer

Helen picture Helen · Jul 21, 2010

The OLE automation interface is only provided by Adobe Acrobat, not Adobe Reader.

If you have Adobe Acrobat installed, you can launch it from VBScript like this:

Set oAcrobat = CreateObject("AcroExch.App")
oAcrobat.Show

For a complete reference of Acrobat's automation API, see the "OLE Automation" section of this document.