Question : Opening PDFs In MS Access

I have an application with a shared back-end and each user has a local copy of the front-end.

I used the below code to open PDFs within a form in my application. The pdfReader object's class is AcroPDF.PDF.1.

This code has worked perfectly for me when all my users had the PDF Browser Control 7.0.7.0 library. Now one of my user's has PDF Browser Control 9.1.0.163 and this form no longer works.

pdfReader.setShowToolbar True
triggered runtime error '438': Object doesn't support this property or method.

pdfReader.Object
triggered runtime error '2683': There is no object in this control.

For my 7.0.7.0 users I use the DLL file located at: C:\Program Files\Adobe\Acrobat 7.0\ActiveX\AcroPDF.dll

For my 9.1.0.163 user the above DLL was automatically replaced by file located at C:\Program Files\Common Files\adobe\acrobat\ActiveX\AcroPDF.dll

I tried registering my 9.1.0.163's DLL manually using regsvr32 however this failed with a return code 0x80070005.

I tried using the 9.1.0.163 DLL on a computer that had the older library but MS Access would not allow me to add this to references list so I'm guessing I can't try to use the old library on the problem user's computer since the versions of Adobe Reader are different.

What can I do to get this working the problem user's computer?
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
Private Sub Form_Load()
Dim pdf As AcroPDF
 
    pdfReader.Height = 8500
    pdfReader.Width = 14500
    pdfReader.setShowToolbar True
 
    Set pdf = pdfReader.Object
    
    If Nz(Me.OpenArgs, "") <> "" Then
        On Error GoTo BadFile
        pdf.LoadFile (Me.OpenArgs)
        
        Err.Clear
        On Error GoTo 0
    End If
        
    Set pdf = Nothing
    
Exit Sub
 
BadFile:
    MsgBox "The scanned cheque could not be accessed." & vbNewLine & "Please notify an administrator immediately.", vbCritical + vbOKOnly
    DoCmd.Close acForm, Me.Name, acSaveYes
End Sub

Answer : Opening PDFs In MS Access

Have you considered opening the PDF with a FollowHyperlink routine?
Random Solutions  
 
programming4us programming4us