Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Thanked 0 Times in 0 Posts

    Hiding text (Word 2000)

    Based on certain conditions I want to be able to hide the text in a word document. I know of a way to do it by changing the text colr to match the background but I wouild think there is a better way. Can anyone tell me. I wish to do this via VBE code.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: Hiding text (Word 2000)

    The Font property of a range has a property Hidden that can be True or False. So:

    myRange.Hidden = True

    where myRange is a variable of type Range, or

    Selection.Font.Hidden = True

    Note: this isn't secure - the user can select to display hidden text in Tools/Options..., View tab.

  3. #3
    Super Moderator
    Join Date
    May 2002
    Canberra, Australian Capital Territory, Australia
    Thanked 406 Times in 335 Posts

    Re: Hiding text (Word 2000)

    Hi Jim,

    Another way of hiding text is with field codes. For example, create one like this:
    {IF{HT}= "" {ASK HT "" d""} {IF{TT}= "" "" {HT}}}

    Now add two bookmarks, named HT and TT at the start of the field.
    Then select the field and press F9. You'll be presented with a dialogue box into which you can type your hidden text.
    After you type in the hidden text and press OK, all you'll see is the place where you put the field. Even if the field code is expanded, your hidden text won't show.

    To display the hidden text, create another field:
    {SET TT 1}
    Now select the original field and press F9. Voila! Hidden text displayed. You can hide it again by changing the TT field to:
    {SET TT ""}
    then updating the original field.

    An alternative way of displaying the hidden text would be to create the following field:

    To change the hidden text, simply delete the HT bookmark and create a new one.


    Paul Edstein
    [MS MVP - Word]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts