View Single Post
 
Old 02-06-2011, 01:30 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Hi rajpes,

Here are two macros to help with the reviewing. The first hides all sentences that have nothing highlighted, the second restores the hidden sentences. With the first macro, even if a single word is highlighted, the whole sentence will be displayed for context.

Code:
Option Explicit
Dim bSH As Boolean, bSA As Boolean
 
Sub ReviewHiLites()
Application.ScreenUpdating = False
Dim RngS As Range, RngW As Range, bHL As Boolean
bSH = ActiveWindow.View.ShowHiddenText
bSA = ActiveWindow.ActivePane.View.ShowAll
For Each RngS In ActiveDocument.Range.Sentences
  With RngS
    bHL = False
    For Each RngW In RngS.Words
      If RngW.HighlightColorIndex <> wdNoHighlight Then
        bHL = True
        Exit For
      End If
    Next RngW
    If bHL = False Then .Font.Hidden = True
  End With
Next RngS
ActiveWindow.View.ShowHiddenText = False
ActiveWindow.ActivePane.View.ShowAll = False
Application.ScreenUpdating = True
End Sub
 
Sub RestoreHiddenText()
Application.ScreenUpdating = False
ActiveWindow.ActivePane.View.ShowAll = bSA
ActiveWindow.View.ShowHiddenText = bSH
ActiveDocument.Range.Font.Hidden = False
Application.ScreenUpdating = True
End Sub
Note: Because the macros toggle Word's 'Hidden text' and 'Show All' display settings, if you run the first macro, you should run the second one before closing the document. Otherwise you might need to re-set these setting manually.

If you need advice on how to install & run macros, see: http://www.gmayor.com/installing_macro.htm
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote