I am trying to automatically open a pdf file in Lotus Notes. I used CreateObject("AcroRd32.application") and I receive the error message, "Cannot create automation object." AcroRd32.exe comes from the Tool Options. However, I did notice in the registry that the file is AcroExch.App. I'm spinning my wheels at this point! Can you help?
I have seen the AcroExch used rather than the AcroRd32. The example below comes from the Experts Exchange Web site. The URL passed is the full URL to the document to be opened, either a HTTP, URL or filepath.
Sub PdfCheck(ByVal URL As String)
        Dim AcroApp As Acrobat.CAcroApp
        Dim PDDoc As Acrobat.CAcroPDDoc
        Dim avDoc As Acrobat.CAcroAVDoc

        AcroApp = CreateObject("AcroExch.App")
        PDDoc = CreateObject("AcroExch.PDDoc")

        If PDDoc.Open(URL) Then
            AcroApp.Show()
            avDoc = PDDoc.OpenAVDoc("")
        Else
            MsgBox("Unable to open the 
PDF-file", vbInformation)
        End If

        avDoc = Nothing
        PDDoc = Nothing
        AcroApp = Nothing
    End Sub

Do you have comments on this Ask the Expert question and response? Let us know.

This was first published in December 2004

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: