Written by Allen Wyatt (last updated December 11, 2021)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365
David is a teacher and he uses Word to create tests and answer sheets. He uses a single document, formatting answers as Hidden text. This way, if he prints with Hidden text turned off, he has the test and if he prints with Hidden text turned on, he has the test and answers. David needs a way to include two images in the document, one on top of the other. That's not the puzzling part, though. He needs one of those images to print if he's printing with Hidden text turned on and the other to print if he's printing with Hidden text turned off.
There are actually a couple of ways you can approach this problem. The first way involves the use of inline images, which can be formatted just like text. This means they can be formatted as Hidden. Assume, for the sake of this example, that you have two images, A and B. You want image A to be printed when you print without Hidden text, and you want B to be printed when you print including Hidden text. Follow these general steps:
Now the correct images will print depending on whether you print with Hidden text displayed or not. If you want, you could also make image A floating; it doesn't need to be inline. Only image B must be inline, as it is only inline images that can be formatted as Hidden. In addition, image B should be opaque, meaning it should not have any transparent areas, and it should be the same size as image A. If image B does have transparent areas or if it is smaller than image A, then it won't fully obscure image A when it is printed.
The other option is to create a macro that you run whenever you want to print your document. The macro can check the setting of the PrintHiddenText property and based on the setting, either display or hide the appropriate images. Here's a quick example:
Sub PrintMyDoc() If Application.Options.PrintHiddenText = True Then ActiveDocument.Shapes(1).Visible = msoTrue ActiveDocument.Shapes(2).Visible = msoFalse Else ActiveDocument.Shapes(1).Visible = msoFalse ActiveDocument.Shapes(2).Visible = msoTrue End If End Sub
In this macro, the first shape in the Shapes collection is set to Visible (and thus will be printed) if you are printing Hidden text. If the PrintHiddenText property is False, then the second shape is made visible and will thus be printed.
The key to using this macro approach is that you must use regular shapes (floating images); you can't use InlineShapes, as those cannot have the Visible property set.
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13375) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 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 MoreIf your document has a lot of markup visible in it, you may want to print a copy of the document that doesn't reflect ...
Discover MoreWord allows you to take full advantage of the capabilities of your printer. Accessing those capabilities is done through ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
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.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments