Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Printing and Exiting Word in a Macro.
by Allen Wyatt
(last updated August 27, 2016)
Robert needs a macro that will load a document, print it out, and then exit Word. He's figured out how to load the document and start to print it, but when he tells the macro to exit Word, he sees a message saying that if he quits, any printing will be deleted.
This message is displayed because the default method for printing in Word is to print in the background, which means that the command to shut down Word is executed while the printing is still going on in the background. The solution is to make sure that background printing is turned off in the print command:
Since printing will be done in the "foreground," the next macro command will not be executed until the printout is complete. In this way, the printing is very much like printing from within Windows itself: right-click a document and choose Print from the Context menu, and Word is loaded, the document printed, and Word then shuts down.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (10778) applies to Microsoft Word 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Word here: Printing and Exiting Word in a Macro.
Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!
If you routinely need to print more than one copy of a document, you'll love the ideas presented in this tip. There's ...Discover More
Tired of your page borders not printing out as you expect? The problem could be due to any number of settings or ...Discover More
We click the button to print our document and seldom think of what is happening behind the scenes. Word prints documents, ...Discover More
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.