View Single Post
 
Old 01-03-2025, 05:20 AM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

For example:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim s As Long, Rng As Range
With ActiveDocument
  For s = .Sections.Count To 1 Step -1
    With .Sections(s)
      Set Rng = .Range: Rng.End = Rng.End - 1
      Rng.Find.Execute FindText:=Chr(12), Replacewith:="", Forward:=True, Wrap:=wdFindStop, Replace:=wdReplaceAll
      If s = 1 Then Exit Sub
      If .PageSetup.SectionStart <> wdSectionContinuous Then .Range.Characters.Last.Delete
    End With
  Next
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote