问题
Is there any way to print a .doc
or .rtf
file from the Windows command line silently?
I am working on a receipt printing application and I would like to perform a silent automatic print using a cmd
command.
回答1:
Wordpad can open rtf, doc and docx files, so you don't even need word. Then you can use wordpad's command line switch to print to the default printer. start wordpad.exe /p "path\filename.ext"
回答2:
Shell is an accepted Windows terminolgy and refers to the graphical user interface. It is known as The Windows Shell. And it can do what you want.
Set xlBook = GetObject("C:\Users\David Candy\Documents\Super.xls")
For each wsheet in xlbook.worksheets
wsheet.printOut
next
At its most basic.
This is VBS using COM.
The malcontents strike
来源:https://stackoverflow.com/questions/29889068/printing-a-ms-word-file-from-cmd