Chuck Wood
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.
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.
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?
ASKER
1. I changed the code to:
Dim doc As New AcroAVDoc
If doc.Open("C:\Temp.pdf","Te mpTitle") 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?
Dim doc As New AcroAVDoc
If doc.Open("C:\Temp.pdf","Te
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 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?
ASKER
I will try that out and see what I can glean from it. Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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","Te mpTitle")
It works fine. Thanks very much.
' 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","Te
It works fine. Thanks very much.