Macro to find and replace

L

Legal Learning

an access field code. I have a field code from Access that needs to be
changed from ClientM to ClientF.

I can not use a regular Word find and replace function to do this so will
need to do it through vba.

The word document template will be connected to the access database and have
the fields available. Any help would be greatly appreciated!
 
J

Jean-Guy Marcil

Legal Learning said:
an access field code. I have a field code from Access that needs to be
changed from ClientM to ClientF.

I can not use a regular Word find and replace function to do this so will

Why not?

Do ALT-F9 to toggle the display of field codes.
Do Find "ClientM" and replace with "ClientF".
Do ALT-F9 again to toggle back to field values.
Do CTRL- A followed by F9 to update the fields if you need to.

Of course there are are other ways, with or without VBA to do this, but
this is fast and easy!
 
L

Legal Learning

They have about 15 of these types of finds and replaces and they want a macro
to do it. Also, is there a way to update just the field codes? There are
tocs and cross references that they don't want updated and selecting all
would do that.
 
G

Graham Mayor

Can you give a better example of what the fields are and what you wish to do
with them? What does Word show when you select ALT+F9 to display the field
codes? Creating a macro to selectively alter, update or fix fields is simple
enough, but it would help to explain it if we knew *exactly* what we are
dealing with and what you are trying to achieve.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top