Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
I am trying to identify duplicate words in a document and either extract or
highlight. After researching this, I am at a loss. Is this possible, and if so, what is the procedure? Thx in advance for the help. |
#2
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
You can highlight (or delete) duplicated words using a macro something like
this: Sub FlagDupWords() Dim oCol As Collection Dim oWord As Range Set oCol = New Collection For Each oWord In ActiveDocument.Words On Error GoTo Err_Handler oCol.Add LCase(Trim(oWord)), LCase(Trim(oWord)) Err_ReEntry: On Error GoTo 0 Next Exit Sub Err_Handler: If Err.Number = 457 Then MsgBox oWord & " is a duplicated word and will be flagged." If oWord.Characters.Last = " " Then oWord.MoveEnd wdCharacter, -1 oWord.HighlightColorIndex = wdBrightGreen Resume Err_ReEntry Else MsgBox Err.Number & " " & Err.Description End If End Sub -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Greg Maxey - Word MVP My web site http://gregmaxey.mvps.org Word MVP web site http://word.mvps.org ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "tturner80126" wrote in message ... I am trying to identify duplicate words in a document and either extract or highlight. After researching this, I am at a loss. Is this possible, and if so, what is the procedure? Thx in advance for the help. |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
code to remove all duplicate words in a document? | Microsoft Word Help | |||
Help! Words duplicate when you hit spacebar | Microsoft Word Help | |||
How can I extract specific words from a document to form a glossar | Microsoft Word Help | |||
How do I duplicate words in a list format | Microsoft Word Help |