Well, based on your sample where words are separated by two spaces, it replaces those two spaces with a temporary marker "***". Then it joined any character separated from any other character with a space. Finally it replaced the temporary marker with a space.
Paul is right, you don't need a macro. You asked for one though. Using Paul's refined construction:
Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey, http://gregmaxey.com/word_tips.html, 5/9/2018
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "([! ])^32 "
.Replacement.Text = "\1"
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
lbl_Exit:
Exit Sub
End Sub
Which basically finds any character not a space and a space and replaces it with that character.