Thread: [Solved] Just MS Word
View Single Post
 
Old 01-09-2014, 04:33 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote