View Single Post
 
Old 11-04-2017, 10:16 AM
FionaMcKenzie FionaMcKenzie is offline Windows 10 Office 2016
Novice
 
Join Date: Oct 2017
Location: Surrey, United Kingdom
Posts: 14
FionaMcKenzie is on a distinguished road
Default

Hi

You can use either a bookmark or a content control, that's entirely up to you and how you structure the document.

To hide the text in a content control:
ActiveDocument.ContentControls.Item(1).Range.Font. Hidden=1

To show the text in a content control:
ActiveDocument.ContentControls.Item(1).Range.Font. Hidden=0

To hide text in a bookmark range:
ActiveDocument.Bookmarks("BookmarkName").Range.fon t.hidden=1

To show text in a bookmark range:
ActiveDocument.Bookmarks("BookmarkName").Range.fon t.hidden=0

To hide the hidden fonts from view:
Activewindow.View.ShowHiddenText = False
ActiveWindow.View.ShowAll=False

If you toggle show/hide button you will still be able to see the hidden text, but it won't print.

If you want the text completely removed, use bookmark ranges and input contents by automating autotext entries.

Let me know if you need help with the later.
Reply With Quote