B
Bruce
I would like to find instances of "MyCompany" and replace
them with "MyCompany MyState". I have already downloaded
an article by Graham Mayor (from the MVP site, I think),
so if your reply is to refer me to that article, I already
have it, thank you. My general approach has been to
search for "MyCompany (anything other than "MyState")" and
replace it with "MyCompany MyState", but between [], [!],
<>, etc. I have managed to generate quite a variety of
worthless error messages, but have made no progress toward
the desired result.
In some cases "MyCompany MyState" appears in the document,
so simply replacing "MyCompany" with "MyCompany MyState"
will not work in all cases. Another wrinkle is that
sometimes "MyCompany" is followed immediately by a
punctuation mark, so I can't search for "MyCompany " (with
the added space).
Another difficulty I have encountered with wildcard
searches is after I have found, for instance, "MyCompany
is growing" I want to replace it with "MyCompany MyState
is growing", but when I have managed to contrive searches
that find "My Company (something other than "MyState")", I
can't avoid replacing the part that follows "MyCompany".
Backslashes seem to enter into solving this, but I can't
make out how they owrk in the Replace part of the function.
I realize I could do a simpler search, and just skip some
replacements as needed, but I have a project that involves
some very large documents that will require extensive
editing, so I would like to make use of Replace if it has
the capabilities I need.
them with "MyCompany MyState". I have already downloaded
an article by Graham Mayor (from the MVP site, I think),
so if your reply is to refer me to that article, I already
have it, thank you. My general approach has been to
search for "MyCompany (anything other than "MyState")" and
replace it with "MyCompany MyState", but between [], [!],
<>, etc. I have managed to generate quite a variety of
worthless error messages, but have made no progress toward
the desired result.
In some cases "MyCompany MyState" appears in the document,
so simply replacing "MyCompany" with "MyCompany MyState"
will not work in all cases. Another wrinkle is that
sometimes "MyCompany" is followed immediately by a
punctuation mark, so I can't search for "MyCompany " (with
the added space).
Another difficulty I have encountered with wildcard
searches is after I have found, for instance, "MyCompany
is growing" I want to replace it with "MyCompany MyState
is growing", but when I have managed to contrive searches
that find "My Company (something other than "MyState")", I
can't avoid replacing the part that follows "MyCompany".
Backslashes seem to enter into solving this, but I can't
make out how they owrk in the Replace part of the function.
I realize I could do a simpler search, and just skip some
replacements as needed, but I have a project that involves
some very large documents that will require extensive
editing, so I would like to make use of Replace if it has
the capabilities I need.