View Single Post
 
Old 10-19-2019, 01:03 PM
jeffreybrown jeffreybrown is offline Windows 10 Office 2016
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Hi Greg,

I spoke too soon. It works fine by removing the duplicate numbering, but because I use two spaces following the numbers in the multilevel list setup, I am now left with four spaces.

I used this to remove the spaces, but it doesn't work for all.
Code:
Sub DeleteSpaces()
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "^13[ ]{1,}"
        .Replacement.Text = "^p"
        .Execute Replace:=wdReplaceAll
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub
It removed the spaces from all the paragraphs except for heading 1.
Reply With Quote