As can be seen from the code in the link I posted, all of your requirements can be met with a straightforward Find/Replace macro without the need to introduce the complications of function calls and looping. Indeed, you shouldn't need both macros - mine can handle the whole task on its own and is somewhat more sophisticated than what you now have and is much more efficient. Unlike yours, mine also doesn't change the selected range.
As to the looping issue with your code, you should be able to resolve that by changing:
.Wrap = wdFindContinue
to:
.Wrap = wdFindStop
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
|