We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to print .docx file to a physical printer by jacob. And it's work as below.
<dependency> <groupId>com.jacob</groupId> <artifactId>jacob</artifactId> <version>1.20</version> </dependency>
public class JacobPrint { static void print( String filePath){// filePath="D:\\1.doc"; ComThread.InitSTA(); ActiveXComponent word=new ActiveXComponent("Word.Application"); Dispatch doc=null; Dispatch.put(word, "Visible", new Variant(false)); Dispatch docs=word.getProperty("Documents").toDispatch(); doc=Dispatch.call(docs, "Open", filePath).toDispatch(); try { Dispatch.call(doc, "PrintOut"); } catch (Exception e) { e.printStackTrace(); }finally{ try { if(doc!=null){ Dispatch.call(doc, "Close",new Variant(0)); } } catch (Exception e2) { e2.printStackTrace(); } ComThread.Release(); } }
But it is color printing. How do I control it to print in color or monochrome?
I have reference to Microsoft's official documentation: Printer.ColorMode property (Access)
But it seems to only work in the Access app, not in Word.
Thanks a lot!
The text was updated successfully, but these errors were encountered:
This isn't a Jacob issue. Jacob will execute whatever calls you need to make. It's a question about the Microsoft COM API for Word.
Sorry, something went wrong.
No branches or pull requests
I want to print .docx file to a physical printer by jacob. And it's work as below.
But it is color printing. How do I control it to print in color or monochrome?
I have reference to Microsoft's official documentation: Printer.ColorMode property (Access)
But it seems to only work in the Access app, not in Word.
Thanks a lot!
The text was updated successfully, but these errors were encountered: