
Tips.Net > WordTips Home > Formatting > Character Formatting > Protecting Hidden Text
Summary: Formatting some of your text as hidden can be a great help when you need to keep some things from being viewed or printed. The hidden text can be easily unhidden by anyone, however. Here’s how to get rid of it so that it can’t be uncovered. (This tip works with Microsoft Word 97, Word 2000, Word 2002, Word 2003, and Word 2007.)
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:
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.
Tip #625 applies to Microsoft Word versions: 97 2000 2002 2003 2007
Create and Merge! Using Word's mail merge tool you can quickly and easily combine data from a variety of data sources to create great individualized documents that incorporate your data in ways that you control. WordTips: Mail Merge Magic is an invaluable source for learning how to harness the full power of Word's mail merging capabilities.
Check out WordTips: Mail Merge Magic today!
Word includes two powerful search engines. Do you know how to use them both? You can discover new knowledge with WordTips: Find and Replace. (more information...)
Ask a Word Question
Make a Comment
Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips