Thread: 2 sets of type
View Single Post
  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Replace command in word

First read http://www.gmayor.com/replace_using_wildcards.htm.

Because of a design mistake that Microsoft has never bothered to fix, you're
going to need two separate passes: one for the word by itself and another
for all other forms of the word. (The problem is that the wildcard syntax
allows you to specify "one or more of these characters" but not "zero or
more".)

First do an ordinary replacement -- whether wildcard or not doesn't
matter -- for just the word. In your example, search for "align" and replace
with the formatted word. The code ^& can be used in the Replace With box to
mean "the text found by the search".

Then do a wildcard search for the expression

align[a-z]{1,}

and again replace with the code ^& and the formatting.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Garrystone wrote:
Hi, i've been trying to use the replace command in Word,but it isn't
working how I would expect. For instance, if I'm wishing to replace
all instances of the word "align" and any combinations of "align"
such as "alignment" then I assumed I need to select the wild card
option. however, it isn't working correctly. I.e. I wish to replace
any instances of "align" with the same word but formatted differently
(bold, case change, etc). However, Word finds all instances but only
formats the "align" part of the word. So the word "alignment" would
have two formats. Does anybody know a solution it is really annoying
me, I've already spent 2 hours trying to sort it out?

Thanks for your help

Garry