![]() |
|
#8
|
||||
|
||||
|
Try the following macro - it doesn't find 'duplicates' where one word uses capitals and the other doesn't, but it should deal with all the rest.
Code:
Sub Demo()
Dim i As Long
Application.ScreenUpdating = False
With ActiveDocument.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "(<[A-Za-z]@>)([!^13]@)<\1>"
.Replacement.Text = "\1\2"
.Format = False
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
End With
Do While i <> Len(.Text)
i = Len(.Text)
.Find.Execute Replace:=wdReplaceAll
Loop
With .Find
.Text = "[ ]{2,}"
.Replacement.Text = " "
.Execute Replace:=wdReplaceAll
End With
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Word 2013 words cut at end of line and other decalations
|
Alex.g | Word | 4 | 06-20-2022 07:50 PM |
How to find and delete duplicate words in doc
|
cinvest | Word | 1 | 09-29-2014 08:34 PM |
| Can anyone solve this problem? | ChrisHoppyBot | Office | 0 | 02-20-2013 01:08 AM |
| Creating different spacing for words on the same line | Jenjen80 | Word | 1 | 08-12-2010 05:52 AM |
| please help me to solve this issue...... | middo1022 | PowerPoint | 0 | 08-28-2009 04:47 AM |