Results 1 to 8 of 8
  1. #1
    Lounger
    Join Date
    Apr 2004
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Highlight Hidden Text in Word (Word 2003)

    I want to highlight hidden text in Word. I thought that this macro would work but it does just the opposite; it sets the Find option to Not Hidden so that all of the text that is not hidden is highlighted.

    Can someone help? Thanks,

    Jerry


    Application.ActiveWindow.View.ShowHiddenText = True
    Application.ActiveWindow.View.ShowHighlight = True
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Font.Hidden = True
    Selection.Find.Replacement.Highlight = True
    With Selection.Find
    .Text = ""
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Highlight Hidden Text in Word (Word 2003)

    I copied the code into a procedure (Sub) and ran it in a document that contains some hidden text (and some non-hidden text). The hidden text was highlighted correctly. Save the document with the macro, then quit and restart Word to see if your problem is a temporary glitch.

  3. #3
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Highlight Hidden Text in Word (Word 2003)

    There was some bug in earlier versions -- see <post#=176502>post 176502</post#> -- but I can't reproduce it in Word2003, either.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

  4. #4
    Lounger
    Join Date
    Apr 2004
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Highlight Hidden Text in Word (Word 2003)

    Hans:

    It does not seem to be temporary. (I am running Word 2003 SP1.)
    When I substitute Selection.Find.Font.Hidden = wdToggle for Selection.Find.Font.Hidden = True then it works.

    Thanks,

    Jerry

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Highlight Hidden Text in Word (Word 2003)

    It seems like an old bug resurfaced on your system. I would recommend using the wdToggle workaround...

  6. #6
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Highlight Hidden Text in Word (Word 2003)

    Hi Jerry,

    Just out of curiosity: Do you have any check-marks in Tools > Options > Compatibility?
    Sometimes these can bring back bugs from older versions.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

  7. #7
    Lounger
    Join Date
    Apr 2004
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Highlight Hidden Text in Word (Word 2003)

    Klaus:

    Whatever the defaults were are selected for earlier versions of Word, these mostly relate to tables. For Word 2003, nothing is selected.

    Jerry

  8. #8
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Highlight Hidden Text in Word (Word 2003)

    Thank you anyway! I thought it was worth a shot.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

Posting Permissions

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