<

How to schedule printing a Word 2007+ document

Published on
3,429 Points
429 Views
Last Modified:
Use Windows Task Scheduler to print a Word document weekly so your printer ink won't dry out.

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:

=====

  • In Trust Center Settings/Trusted Locations check the box to Allow Trusted Locations on my network (even though it's "not recommended")
  • In Trust Center Settings/ActiveX Settings check the button to Enable all controls without restrictions and without prompting (again, even though it's "not recommended")
  • In Trust Center Settings/ActiveX Settings check the box for Safe mode
  • In Trust Center Settings/Macro Settings check the button to Enable all macros (again, "not recommended")
  • In Trust Center Settings/ActiveX Settings check the box to Trust access to the VBA project object model

=====

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

  • change the user to an Administrator account
  • check "Run whether the user is logged on or not"
  • leave "Do not store password" unchecked
  • check "Run with highest privileges"
  • configure for your version of Windows
  • click OK, and provide the administrator account password


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.

0
Comment
Author:Alan Varga
0 Comments

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Join & Write a Comment

In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Wrapper-1-Query. Use an Excel function to calculate a column for an Access query. Part 1. Shows a query in Access that has a calculated column with the results of an Excel worksheet function. See how to call a wrapper function from a query, and …

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month