View Single Post
 
Old 06-17-2021, 03:39 PM
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

Without seeing some sample content, it's hard to know exactly what needs to be done. Try:
Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
  With .Find
    .Wrap = wdFindStop
    .MatchWildcards = True
    .Text = "[! ^13]@[!.\!\?:;]^13"
    .Replacement.Text = ""
    .Execute
  End With
  Do While .Find.Found = True
    Select Case Trim(.Words.First)
      Case "and", "but", "or", "then"
        'do nothing
      Case Else
      .Words.First.InsertAfter ";"
    End Select
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote