View Single Post
 
Old 03-28-2022, 02:52 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,359
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

There is a way of doing this, but its progress won't exactly be stellar on long documents:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim wdPage As Page, wdRct As Rectangle, wdRng As Range, wdLine As Line
For Each wdPage In ActiveDocument.ActiveWindow.Panes(1).Pages
  For Each wdRct In wdPage.Rectangles
    For Each wdLine In wdRct.Lines
      Set wdRng = wdLine.Range
      With wdRng
        If .Characters.Last.Text Like "[–—]" Then
          .MoveEndUntil Cset:=" ", Count:=wdBackward
          .InsertAfter Chr(11)
        End If
      End With
    Next
  Next
Next
Application.ScreenUpdating = True
End Sub
Do be aware of the caveats in my previous post.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote