It seems as if the commented lines got wrapped to the next line. Try copying
this version instead:
Sub SpaceAfterPeriod()
'Inserts a space after the period when the text is $.$
'where $ represents
'any letter.
'Does not insert the space, if a space already exists as in $. $
'Does not insert a space if a number precedes or follows the period.
ActiveDocument.Range.Find.Execute Findtext:="([A-Za-z].)([A-Za-z])", _
MatchWildcards:=True, Wrap:=wdFindContinue, Replacewith:="\1 \2", _
Replace:=wdReplaceAll
End Sub
Just in case, test the macro on a copy of your document first.
--
Stefan Blom
Microsoft Word MVP
---------------------------------------------
"Anne J" wrote in message
I just want to know what Ed Weber wrote. He wrote some macro which could do
the job well, but I don't know how to copy it cause it's all messed up..
I need a script which would allow me to add space after/and before certain
words and/or letters/numbers. Let's say I want to add space before numbers
1-8, but not before number 9.
So, I have a popsicle. 6 of them.
and
So, I have a popsicle.9 of them. Space has been put before 6, but Not before
9. Let's say I have to be more specific regarding certain numbers, letters,
words after which/or before I have to put space. I need a script in VBA
which would allow me to add/remove those exceptions at will.