I receive an error message, "Cannot create automation object".
Problem:
I receive an error message, "Cannot create automation object".
1) I have PDF-XChange 4.0 installed as default printer, and the printer name is "PDF-XChange."
Now we have a Notes application, where I'm using the following coding to set an OLE Automation object, coding doesn’t work with the error message "Cannot create automation object" - the coding is as below.
I know there must be problem with the parameters in 'CreateObject', but I don't know what the right application name / Class name for PDF-XChange 4.0.
2) How can I tell the system to wait until the print job is done?
Code (VBA):
Dim objPrinter As Variant
set objPrinter = CreateObject( "PDFXChange.clsPDFXChange")
Resolution:
1) See code below for creating printer object:
Code (VBA):
Dim objFactory as Variant
Dim objPrinter as Variant
Set objFactory = CreateObject("PXCComLib.CPXCControlEx")
Set objPrinter = objFactory.Printer("", "<name of your printer>", "<YOUR REG CODE>", "<YOUR DEV CODE>")
Dim objPrinter as Variant
Set objFactory = CreateObject("PXCComLib.CPXCControlEx")
Set objPrinter = objFactory.Printer("", "<name of your printer>", "<YOUR REG CODE>", "<YOUR DEV CODE>")
2) To tell the system to wait until the print job is finished - you need to incorporate a wait loop until one of the events;
OnError, or OnDocumentSpooled, fire.
More Like This
-
KB#72: How do Icopy an image from an existing PDF file to a new PDF file and retain the original dimensions?
-
KB#227: I have an issue using the PDF-XChange SDK sample code with Microsoft Visual Basic in 'Interactive Mode' for debugging.
-
KB#50: Error when running application scheduled task
-
KB#51: I have a problem with my web application making calls to PXCLIB40.dll when running in 64 bit development environment
-
KB#118: Can I use the PDF-XChange print driver from Delphi 5 to save a Quick Report as a PDF file without user intervention?