This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.
This should work for Word 2007+. Older articles mention a way to start Word, but they imply the functionality to print a document to the default printer is automatically built in; it is not.
The location of options will change depending on which version of Word you are using, but here's the general idea:
Open your test document (.docx) and re-save it as a macro-enabled document (.docm). Use Alt+F11 to open the Visual Basic for Applications environment and insert a new module (NOT a class module). In the module paste this text:
Option Explicit Sub FilePrintDefault() ActiveDocument.PrintOut Application.Quit End Sub ' FilePrintDefault
Save the module and save the document.
To test, use Alt+F8 to run the macro FilePrintDefault. Word will print the document and then quit.
As found on other Internet sources, you can now paste this line in a text command file (e.g. "HP testprint.cmd") and edit it for your version of Word, and whatever your test document name is.
"%ProgramFiles(x86)%\Microsoft Office\Office14\WINWORD.EXE" /mFilePrintDefault "\\whserver02\Public\Printers\RGB HP Deskjet 3000 datetime.docm"
This will open your document in Word and run the macro, which includes the instruction to quit. (Otherwise your print spooler may get messed up, which frustrated me for a long time.)
To test, run the command file from a command prompt (Win+R, "cmd"). Word will print the document and then quit.
Finally, create a scheduled task. To make changes you will need the Properties window available.
On the Actions tab choose the action to start a program. The name of the command file will be the Program/Script to run. No arguments are needed; any of that is contained in the command file.
On the General tab
To test, run the task immediately.
To test further, change the Triggers time to one minute past current for today and wait for the test document to print and close Word. If successful, change the Trigger back to the desired schedule.
|[Error Solved] The Microsoft Jet Database Engine Stopped the Process||349|
|How to fix: PaperPort shows the splash screen then immediately closes - cannot run PaperPort||6,801|
|PaperPort will not install - the installer detected a previous installation||680|
|Using "global" variables in MS Access||104|