View Single Post
 
Old 09-29-2014, 08:48 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

There are numerous problems with this approach:
1. Your approach modifies Word's .ShowHiddenText property, which necessarily applies to all documents. You cannot use it to apply to just one document or even part of one document. In any event, this doesn't stop such text appearing on printouts.
2. Trying to control document content by hiding/unhiding text, which can be done for just a nominated range (e.g. a bookmarked range) is quite unreliable. That's because whether the text displays or prints (even if not displayed) are controlled by Word configuration settings that are independent of the document. You would have to manipulate those settings as well. When you do this, you need to both trap the user's original configuration and switch back to that whenever they switch to another document or close yours; otherwise, you risk compromising they way they want their systems to work.

For proper control, you need to conditionally add/delete the variable content or vary its display/non-display via field coding.

PS: When posting code, please use the code tags. They're on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote