Acrobat OLE object problem

Z

Zachariah

I got a little button that's supposed to get me a pdf.
Here's the Click() code:

Private Sub GetPDF_Click()

Dim App As Acrobat.CAcroApp
Dim PDDoc As Acrobat.CAcroPDDoc
Dim stPdfFile As String

Set stPdfFile = "C:\testcase.pdf"

Set App = CreateObject("AcroExch.App")
Set PDDoc = CreateObject("AcroExch.PDDoc")
PDDoc.Open (stPdfFile)

End Sub

Problem is it complie errors (User-defined Type Not
Defined). Anybody ever work with the Acrobat OLE
Automation Object who can help me out?
 
R

Ron Weiner

Have you included a reference to the Acrobat Type library in your app?

Go to Tools | References and add the reference.

Ron W
 
A

Albert D. Kallal

To open the pdf file?

Try:

dim strPdfDoc as string

strPdfDoc = "C:\testcase.pdf"

strPdfDoc = chr(34) & strPdfDoc & chr(34)

call shell("start " & strPdfDoc,1)

Works for me. In fact, you can use the above for word, or any type of doc...
 
Z

Zachariah

I did make sure the reference is there,but it didn't help.
At this point my Click() code looks like this:

Private Sub GetPDF_Click()

Dim AcroExchApp As Object
Dim AcroExchPDDoc As Object
Dim stPdfFile As String

stPdfFile = "C:\testcase.pdf"
Set AcroExchApp = CreateObject("AcroExch.App")
Set AcroExchPDDoc = CreateObject("AcroExch.PDDoc")

AcroExchPDDoc.Open stPdfFile

End Sub

When I click my button now I see an hourglass flash, no
errors, but nothing else happens. Any ideas?
 
Z

Zachariah

Nope. No luck. The code isn't breaking now but the
testcase.pdf isn't showing either. I even added a
AcroExchApp.Show to make sure Acrobat would pop up for me
and it did, but the AcroExchPDDoc.Open statement doesn't
seem to be doing anything.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top