Programmer_n
04-17-2016, 03:25 AM
I need a space after punctuation. The code below helps, when the track changes is off. But when Track changes is on it gives funny results. To avoid leaving a space in decimal digits of number, the criteria is to find a letter before and after the punctuation. But, I am facing a strange problem if the track changes is on.
Sample sentence.
On the Insert tab, the galleries include items that are designed to coordinate with the overall look of your document.You can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks.
Works fine with with track changes switched off.
ActiveDocument.Range.Find.Execute Findtext:="([A-Za-z].)([A-Za-z])", _
MatchWildcards:=True, Wrap:=wdFindContinue, Replacewith:="\1 \2", _
Replace:=wdReplaceAll
On the Insert tab, the galleries include items that are designed to coordinate with the overall look of your document. You can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks.
For same code final outcome with Track changes on
On the Insert tab, the galleries include items that are designed to coordinate with the overall look of your document.t Y.Y ou can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks.
Is there a better approach to solve my problem. One more thing I used an auto-correct code to get the first auto suggestion for spelling and spacing problem. It works for most cases except for words containing punctuation in-between like (document.you). I am not sure, Why?
Sample sentence.
On the Insert tab, the galleries include items that are designed to coordinate with the overall look of your document.You can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks.
Works fine with with track changes switched off.
ActiveDocument.Range.Find.Execute Findtext:="([A-Za-z].)([A-Za-z])", _
MatchWildcards:=True, Wrap:=wdFindContinue, Replacewith:="\1 \2", _
Replace:=wdReplaceAll
On the Insert tab, the galleries include items that are designed to coordinate with the overall look of your document. You can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks.
For same code final outcome with Track changes on
On the Insert tab, the galleries include items that are designed to coordinate with the overall look of your document.t Y.Y ou can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks.
Is there a better approach to solve my problem. One more thing I used an auto-correct code to get the first auto suggestion for spelling and spacing problem. It works for most cases except for words containing punctuation in-between like (document.you). I am not sure, Why?