Hi Macropod
Apologies for being stupid. I should have recognised the regex expression. My only excuse is that I didn't recognise the two Chrw so just assumed they were something special in word.
Your suggestion of using chrw(12288) was one of the methods that I tried once I worked out what the character value was. As I reported above all that happens is that each and every space character in the document is replaced by a tab.
The specific code I used is as below
Code:
With ActiveDocument.StoryRanges(wdMainTextStory).Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ChrW(12288)
.Replacement.Text = "^t"
.Wrap = wdFindContinue
.Execute Replace:=wdReplaceAll
End With
If you try the above on the sample document I provided you will see the problem. I'm certainly finding it perplexing.