View Single Post
 
Old 02-26-2019, 01:53 PM
kilroy kilroy is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Sep 2016
Location: Southern Ontario
Posts: 118
kilroy is on a distinguished road
Default

If you're just looking to put each sentence on a single line this will work assuming each sentence ends with a period and then a space and no numbered or bulleted paragraphs like macropod pointed out. I know there's a way to include all punctuation you would normally see at the end of a sentence but I don't know it.

Code:
Sub FindReplaceX2()
Selection.WholeStory
With Selection.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = ". "
    .Replacement.Text = ".^p"
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchAllWordForms = False
    .MatchSoundsLike = False
    .MatchWildcards = True
    Selection.Find.Execute Replace:=wdReplaceAll
End With
Selection.WholeStory
With Selection.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "^13{2,}"
    .Replacement.Text = "^p"
    .Forward = True
    .MatchWildcards = True
    .Execute Replace:=wdReplaceAll
End With
End Sub
Reply With Quote