View Single Post
 
Old 10-05-2023, 07:42 AM
RobiNew RobiNew is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Sep 2023
Posts: 208
RobiNew is on a distinguished road
Question Remove spaces before each paragraph mark in text and footnotes

The following code does its job, but is there a more efficient way to obtain the same result? Thanks!



Code:
Dim oRng As Range
Dim iType As Integer
  For iType = 1 To 2
Set oRng = ActiveDocument.StoryRanges(iType)
  With oRng.Find
    .ClearFormatting
    .Text = " ^p"
    While .Execute
      oRng.Characters.First.Delete
      oRng.Collapse wdCollapseEnd
    Wend
  End With
    Next iType
Reply With Quote