问题
I'm trying to send multiple copies of a file to a printer using the win32com library. Printing a single copy works fine, but it appears the Copies parameter doesn't affect the number of copies printed (even if I put Copies=2, as below, it only ever prints out a single page).
from win32com import client
word = client.Dispatch("Word.Application")
word.Documents.Open(file_to_print)
word.ActivePrinter = printer
word.ActiveDocument.PrintOut(Copies=2)
word.ActiveDocument.Close()
word.Quit()
If this additional information helps, I am using Python 3.4 and Word 2013.
If there is a superior way to just open and then print a .docx file from python that would also be a wonderful answer. Thanks!
回答1:
I've had the exact same problem, it seems the win32com module doesn't take those parameters into account. You could simply execute it twice if 2 copies is all you want, but for other parameters like PrintZoomColumn
it would prove a problem.
来源:https://stackoverflow.com/questions/27951496/how-to-print-multiple-copies-of-a-file-using-win32com-or-an-alternative