View Single Post
 
Old 02-03-2015, 04:30 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

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]
Reply With Quote