Got an OLE2 error for Application.WordBasic.FilePrintSetup: There is a printer error
Issue
The Core scripting command PrintDocument is used for printing a document via Microsoft Word. This command results in the following error:
Got an OLE2 error for _Application.WordBasic.FilePrintSetup: There is a printer error. in Microsoft Word. wCode = 0, scode = 800a0460.
Cause
When the specified printer cannot be found, Microsoft Word returns an error for "_Application.WordBasic.FilePrintSetup". The name of the used printer is case sensitive. In terms of case sensitivity, the specified printer name must also match with the printer name in Windows.
Solution
To determine the correct name of the printers installed on the system, KCM comes with the tool QueryPrinters.exe. To use this tool:
- Open command prompt.
- Navigate to <Root>\KCM\Programs\<version>\ITP Server\Tools
- Run
QueryPrinters.exe - Read the correct printer name. After each numbered item ( [XX] ), the case sensitive printer name is specified. E.g.
[01] PDFConverter ITPDP [core_01_5.4] #1 - In the used Core script, change the printer name in the WFWPrinter to the correct printer name.
Example:
The goal is to print a Word document to XPS using the Microsoft XPS printer driver. In the logging it can be observed, that an error occurred.
May 10 15:32:27.507[4] [.]: Built-in PrintDocument. May 10 15:32:27.507[4] [.]: Src ("d:\temp\result.docx") May 10 15:32:27.507[4] [.]: WFWPrinter ("Microsoft document Writer") May 10 15:32:27.507[4] [.]: File ("d:\temp\result.xps") May 10 15:32:27.507[3] [.]: Identified file d:\temp\result.docx to be a MS Word (DOCX) file. May 10 15:32:27.508[3] [.]: Opening d:\temp\result.docx. May 10 15:32:27.582[3] [.]: Ok... opened the document. May 10 15:32:27.586[0] [.]: Got an OLE2 error for _Application.WordBasic.FilePrintSetup: There is a printer error. in Microsoft Word. wCode = 0, scode = 800a0460.
Running QueryPrinters.exe provides the following output.
D:\KCM\Programs\5.4\ITP Server\Tools\QueryPrinters.exe Found 2 printers [01] PDFConverter ITPDP [core_01_5.4] #1 Port (list): NUL: Driver: Amyuni Document Converter 600 Printer provides 4 bins [01] (015) Default bin [02] (004) Manual feed [03] (256) Bin 1 [04] (257) Bin 2 [02] Microsoft XPS Document Writer Port (list): PORTPROMPT: Driver: Microsoft XPS Document Writer v4 Printer provides 1 bins [01] (015) Automatically Select
As can be observed, the printer name is "Microsoft XPS Document Writer". The error occurred due to misspelling the printer name:
May 10 15:32:27.507[4] [.]: WFWPrinter ("Microsoft document Writer")
The resolution is to use WFWPrinter ("Microsoft XPS Document Writer") for the Microsoft XPS Printer.
May 10 15:32:43.494[4] [.]: Built-in PrintDocument. May 10 15:32:43.494[4] [.]: Src ("d:\temp\result.docx") May 10 15:32:43.494[4] [.]: WFWPrinter ("Microsoft XPS Document Writer") May 10 15:32:43.494[4] [.]: File ("d:\temp\result.xps") May 10 15:32:43.494[3] [.]: Identified file d:\temp\result.docx to be a MS Word (DOCX) file. May 10 15:32:43.495[3] [.]: Opening d:\temp\result.docx. May 10 15:32:43.568[3] [.]: Ok... opened the document. May 10 15:32:44.178[3] [.]: Print is done...
Level of Complexity
Moderate
Applies to
Product | Version | Build | Environment | Hardware |
---|---|---|---|---|
Kofax Communications Manager | all versions | n/a | n/a | n/a |
Article # 3035863