
Adobe Acrobat - ActiveX - VBScript
Pardon me in advance please for the length of this, I'm
trying to present enough information for someone to be
able to answer my question.
I'm trying to control Acrobat (_not_ the Reader, but
the full product) via Client-side VBScript.
Yes, this is an intranet environment, so security isn't a problem.
The problem is that the page below loads,
and everything works up until the line marked with '***':
I get the error message "Error: Object Required 'PDDocObject.GetNumPages'"
I added some debugging code to print the VarType of PDDocObject,
and it returns a '9', same as the AVDocObject, AVPageObj and AcroObject.
The Acrobat SDK definitely defines GetNumPages a:s a method for an
object of type PDDoc. (Method GetPDDoc returns an object of type PDDoc)
Since my method call GetAVPageView properly returns an AVPage object,
I can only assume that the GetPDDoc method is working as well.
AcroExch.App has a CLSID = {85DE1C45-2C66-101B-B02E-04021C009402}
AcroExch.AVDoc = {72498821-3203-101B-B02E-04021C009402}
AcroExch.PDDoc = {FF76CB60-2EC8-101B-B02E-04021C009402}
AcroExch.AVPage does NOT appear in the registry.
App and AVDoc have entries in the registry under H_C_R\CLSID,
but PDDoc does not. Since AVPage doesn't appear by name in the
registry, I don't know if there's a CLSID associated with it.
Any information that anyone can provide would be most appreciated.
<HTML>
<HEAD><TITLE>A Simple First Page</TITLE>
<SCRIPT LANGUAGE="VBScript">
<!--
option explicit
Dim AcroObject, AVDocObject, PDDocObject, AVPageObj
Sub Button1_OnClick
dim DocPageCount, msg
SET AcroObject = CreateObject("AcroExch.App")
call AcroObject.Show()
set AVDocObject = CreateObject("AcroExch.AVDoc")
call AVDocObject.Open("c:\readme.pdf", "ReadMe")
set AVPageObj = AVDocObject.GetAVPageView
set PDDocObject = AVDocObject.GetPDDoc
call AVPageObj.goto(5)
*** set DocPageCount = PDDocObject.GetNumPages
End Sub
-->
</SCRIPT>
</HEAD>
<BODY>
<H3>A Simple First Page</H3><HR>
<FORM NAME="AnnotMgr"><INPUT NAME="Button1" TYPE="BUTTON" VALUE="Launch Acrobat">
<P>
<P>
<TEXTAREA NAME="txtDebug" ROWS="10" COLS="60"> </TEXTAREA>
</FORM>
</BODY>
</HTML>