Acrobat OLE object problem

  • Thread starter Thread starter Zachariah
  • Start date Start date
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?
 
Have you included a reference to the Acrobat Type library in your app?

Go to Tools | References and add the reference.

Ron W
 
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...
 
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?
 
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.
 
Back
Top