Hi
I need to print on demand 7 external PDF documents.
I've already successfully implemented the legacy methods of using the shell command and passing the /t print command line, as shown here: thread707-860631
I now have Adobe Acrobat & Reader 8.0 where this method no longer works.
There is a OLE interface / object model but I can't get it running.
I get
Error Number: 429
Error Description : ActiveX component can't create object
This error occurs at any of the lines of code after the Dim statements. (First attempts have been commented out).
Here are some attempts at the code:
Perhaps it is related to this similar error,
faq705-2882 indicating the DLL needs to be re-registered?
Thanks in advance for any help.
Cheers everyone
Zollo VBA Developer
I need to print on demand 7 external PDF documents.
I've already successfully implemented the legacy methods of using the shell command and passing the /t print command line, as shown here: thread707-860631
I now have Adobe Acrobat & Reader 8.0 where this method no longer works.
There is a OLE interface / object model but I can't get it running.
I get
Error Number: 429
Error Description : ActiveX component can't create object
This error occurs at any of the lines of code after the Dim statements. (First attempts have been commented out).
Here are some attempts at the code:
Code:
Public Sub AcrobotPrintDoc(DocPath As String)
On Error GoTo ErrorHandler
Dim AcApp As Acrobat.AcroApp
Dim AcAvDoc As Acrobat.AcroAVDoc
'Set AcApp = CreateObject("AcroExch.App")
'Set AcAvDoc = CreateObject("AcroExch.AVDoc")
Set AcApp = New Acrobat.AcroApp
Set AcAvDoc = New Acrobat.AcroAVDoc
If AcAvDoc.Open(DocPath, Null) Then
MsgBox "Error Opening Document"
GoTo ExitHere
End If
AcApp.GetActiveDoc
If Not AcAvDoc.PrintPagesSilent(1, 1, 2, 1, 1) Then
MsgBox "Error Printing Document"
GoTo ExitHere
End If
ExitHere:
On Error Resume Next
AcAvDoc.Close (1) 'Close without saving param must be >0
AcApp.CloseAllDocs
AcApp.Exit
AcApp = Nothing
AcAvDoc = Nothing
Exit Sub
ErrorHandler:
MsgBox "Error Number: " & Err.Number & vbCrLf & _
" Error Description : " & Err.Description
Resume ExitHere:
End Sub
Perhaps it is related to this similar error,
faq705-2882 indicating the DLL needs to be re-registered?
Thanks in advance for any help.
Cheers everyone
Zollo VBA Developer