Link to home
Start Free TrialLog in
Avatar of Chuck Wood
Chuck WoodFlag for United States of America

asked on

Why is open Acrobat document from VBA not visible?

I open an Acrobat PDF document from VBA and it is open but not visible.
How can I make it visible?

Code:

    Dim doc As New AcroPDDoc
    If doc.Open("C:\Temp.pdf") Then
        MsgBox "Opened C:\Temp.pdf"
    Else
        MsgBox "Could not open C:\Temp.pdf"
    End If

I receive the Opened C:\Temp.pdf message box but can't see the document.
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

You are opening a PDDoc - these are opened "behind the scenes". You need to use an AVDoc to display the document.
Do you have access to the IACOverview and IACReference documents from Adobe?
Avatar of Chuck Wood

ASKER

1. I changed the code to:

    Dim doc As New AcroAVDoc
    If doc.Open("C:\Temp.pdf","TempTitle") Then
        MsgBox "Opened C:\Temp.pdf"
    Else
        MsgBox "Could not open C:\Temp.pdf"
    End If

I got the error: There was an error opening this document. This file cannot be found.

2. No, I do not have access to the documents. Where can I find them?
The Overview document is only available for SDK subscribers or ASN members, but you can download the reference document from here: http://partners.adobe.com/public/developer/acrobat/sdk/index_doc.html#iac

I am no VB programmer, but your code does not look right. See if the reference document does help. Which version of Acrobat are you using?
I will try that out and see what I can glean from it. Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I changed the code using some of the information in the reference document:

   ' requires a reference to Adobe Acrobat 7.0 Type Library
    Dim ac As New Acrobat.AcroApp
    ac.Show
    ac.Maximize 1
    Dim doc As New AcroAVDoc
    doc.Open("C:\Temp.pdf","TempTitle")

It works fine. Thanks very much.