Dear Experts:
I came up with the following macro to insert a nonbreaking space
between the =A7-symbol followed by any number of blank spaces (usually
one or two) and any following number. For example:
=A7nonbreakingspace138 (=A7 138).
It is running fine. See the code below.
Sub InsertNonBreakingSpace()
Dim rngStory As Range
For Each rngStory In ActiveDocument.StoryRanges
With rngStory.Find
.Text =3D "(=A7) {1;}([0-9])"
.MatchWildcards =3D True
.Execute Replace:=3DwdReplaceAll, ReplaceWith:=3D"\1^s\2"
End With
Next rngStory
End Sub
But now I would like to expand the macro to insert a nonbreaking
space not only after the =A7-symbol but also after the number (can be a
number with one, two, three, four etc. digits) that immediatley
follows the first nonbreaking space as in:
=A7-NonbreakingSpace-138-NonbreakingSpace-Corporate Code (=A7 138
Corporate Code)
I did not manage to re-write my code to include the second nonbreaking
space.
Help is appreciated. Thank you very much in advance.