Code: Select all
Sub Macro1()
'''
''' I had reason quickly to change some soft spaces to hard spaces to stop "Win 8" and "from 3.1" etc from breaking across lines.
'''
'''
Selection.HomeKey Unit:=wdStory ' go to top of document
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^$ ^#"
' .Replacement.Text = "^&" ' we will do our own replacement
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
While Selection.Find.Execute
Dim strText As String
strText = Left(Selection.Text, 1) & Chr(160) & Right(Selection.Text, 1) ' replace soft space with hard space
Selection.Text = strText
Wend
End Sub