View Single Post
 
Old 10-23-2023, 11:51 AM
vivka vivka is offline Windows 7 64bit Office 2016
Expert
 
Join Date: Jul 2023
Posts: 302
vivka is on a distinguished road
Default

Hi, Robinew! The Macropod's code does work on footnotes! I've checked it. Try replacing {1;} with {1,}, just in case.
Code:
Sub Del_Spaces_Starting_Paras()
'In selection, delete spaces & unbr spaces starting paragraphs
'including the doc's 1st paragraph.

Dim myRng As range
    
Application.ScreenUpdating = False
  Set myRng = ActiveDocument.StoryRanges(2)
    selection.Find.ClearFormatting
    selection.Find.Replacement.ClearFormatting
    With myRng.Find
        .text = "[^32^s]{1;}([!^13]@^13)"
        .Replacement.text = "\1"
        .Forward = True
        .Wrap = wdFindStop
        .Format = False
        .MatchWildcards = True
        .Execute Replace:=wdReplaceAll
    End With
Application.ScreenUpdating = True
End Sub

Last edited by vivka; 10-24-2023 at 06:17 AM.
Reply With Quote