Avatar of cwest1
cwest1
Flag for United States of America asked on

search and replacing mergfield names in Word

I have about 50 docx documents that use about 20 mergefields. Several of the  mergefield names in the DB from which data is pulled are changing. I'm looking for suggestions to globally search and replace mergefield names, hopefully for all files at the same time.

Thank you.
Microsoft Word

Avatar of undefined
Last Comment
cwest1

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
GrahamSkan

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
cwest1

ASKER
Thank you for the example. I'm not familiar enough with vbs to know why I get an error running the script at Line 2, Char 1. (Expected end of statement.) Is there something I can change.
GrahamSkan

It's not VBS, it's VBA in the form of a Word macro.

The later part of this article explains the basics of VBA editing:
https://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Word/A_7236-Macro-code-to-convert-text-to-fields-in-Microsoft-Word.html
cwest1

ASKER
Thank you for your help. Much appreciated.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy