#1
|
|||
|
|||
How to filter sentences wth highlighted colour
Hi i have a word document with many paragraphs containing many sentences.
In some of the paragraphs i have highlighted some sentences with red mark. Now i don't want to scroll though whole document to read them. Instead i want some way to read only those sentences by filtering wanted/unwanted things. Any possible solution? Thanks |
#2
|
|||
|
|||
Make sure Show/Hide is turned on.
Select all then right-click on it and choose Font> Check "Hidden". Deselect the document text Click the Replace button If the More button is displayed, click it Click in Find What box and click Format > Highlight Click in Replace With box and click Format > Font > Uncheck Highlight Replace All Turn off Show/Hide |
#3
|
||||
|
||||
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 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] |
#4
|
|||
|
|||
Thanks for you replies.I was wondering if there is a way to remove those hidden text so that all the required( highlighted) sentences are just one below other for the sake of better readability.
Thanks again. |
#5
|
||||
|
||||
Quote:
I've been away for a few weeks, hence the delay in replying. Whilst changing the code so that sentences in different paragraphs retain a paragraph's space between them, trying to do that for multiple sentences in the same paragraph will create problems. That's because it would be difficult to keep differentiate any line breaks inserted by the code from any inserted by the user.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
filter, highlight |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sentences and paragraphs keep disappearing in Word XP (2002) at bottom of page | urobolus | Word | 3 | 08-26-2011 10:02 AM |
keep only sentences beginning with: Wind | Michael007 | Word VBA | 3 | 01-17-2011 04:11 PM |
Prevent highlighted only message from opening | Rickkimbrell | Outlook | 2 | 12-16-2009 07:42 AM |
Highlighted Selection on Action Settings | mos7sad | PowerPoint | 0 | 10-12-2009 07:48 AM |
capitalize first letter of sentences | norco1 | Word | 0 | 06-25-2006 12:37 PM |