Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. 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: Protecting Hidden Text.

Protecting Hidden Text

Written by Allen Wyatt (last updated January 11, 2024)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


Hidden text is a great help to those who want to "hide" certain parts of a document, either from viewing or from printing. However, it is not very good for hiding information that you don't want others to see in a document you are distributing. They (the ones to whom you are distributing the document) can display or print hidden text just as easily as you can.

There is no built-in feature of Word that allows you to "lock" hidden text so it can't be viewed. The best solution, then, is to simply remove all your hidden text as a last step before distributing your document. You can do this by using the Search and Replace features of Word, as follows:

  1. Press Ctrl+H. Word displays the Replace tab of the Find and Replace dialog box.
  2. Click on the More button, if it is available. (See Figure 1.)
  3. Figure 1. The Replace tab of the Find and Replace dialog box.

  4. Position the insertion point in Find What box and make sure it is empty.
  5. Click on the Format button and choose Font. Word displays the Find Font dialog box. (See Figure 2.)
  6. Figure 2. The Find Font dialog box.

  7. Click on the Hidden attribute check box until it has a solid black check mark in it. (You may have to click it more than once.)
  8. Click on OK. The Find Font dialog box disappears and the words "Format: Hidden" should appear just below the Find What box.
  9. Make sure the Replace With box is empty.
  10. Click on Replace All.

If you find yourself stripping out hidden text quite a bit, you can automate the process by recording a macro that performs the above steps, or you can use the following macro:

Sub StripAllHidden()
    Dim rngsStories As Word.StoryRanges
    Dim rngStory As Word.Range

    On Error GoTo NoDocOpen
        Set rngsStories = ActiveDocument.StoryRanges
    On Error GoTo 0

    'Need to loop through all 'stories' to
    'remove hidden text from footnotes, headers,
    'etc. as well as body text.

    For Each rngStory In rngsStories
        With rngStory.Find
            .ClearFormatting
            .Font.Hidden = True
            Call .Execute(vbNullString, False, False, False, _
                False, False, True, wdFindContinue, True, _
                ReplaceWith:=vbNullString, _
                    Replace:=wdReplaceAll)
        End With
    Next
    Exit Sub
NoDocOpen:
End Sub

The other advantage of using this macro is that it will also look for hidden text in places where the regular Search and Replace function won't: footnotes, endnotes, headers, footers, etc.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (12438) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. You can find a version of this tip for the older menu interface of Word here: Protecting Hidden Text.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Printing via Macro without Messages

When you are printing a document, it is not unusual to see messages (dialog boxes) periodically. When you want the ...

Discover More

Opening Only a Merge Document

After merging the information from a data source into a document, you may decide that you only want to open the merge ...

Discover More

Columns in a Text Box

Want to divide a text box into columns? Word doesn't allow you to do this, but there are ways to work around the limitation.

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (ribbon)

Understanding Monospace Fonts

Monospace fonts allow you to easily achieve a specific "look" with your text or to line up information in a certain way. ...

Discover More

Specifying Font Styles

Fonts, by default, come with one or more styles that define variations of how that font is displayed in your document. ...

Discover More

Retaining Explicit Formatting after Applying Styles

The formatting in a document is often a mix of styles and explicit formatting, applied over time. You may want to apply ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is three less than 9?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

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.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.