1

MacOS Sonoma 14.5

Macbook Pro M1

Office 365 (Institutional) (.docx not required)

I have about 50 documents that require swapping names within the document for ID codes. The documents are 30-40 pages each, and have ~15 instances of name swapping each. All names correlate with an ID. So for example:

name: Mary Poppins becomes: P123456

name: Donald Duck becomes: P590834

Luckily, none of the names coincide - there is only one Mary, and one Donald, and so forth. This means I Should be able to Find+Replace across multiple documents to accomplish the task.

The documents are currently .docx but I can easily convert them to .txt and back if need be. All files are in the same folder.

I have seen several fixes, but they tend to be outdated or intended for Windows, such as:

VBA Find and Replace

Word Macro Fixes

I suspect I can do this with Automator, but my tests so far have accomplished nothing.

1 Answer 1

1

For text files, BBEdit can search and replace across multiple files with its Multi-file search function.

picture of BBEdit menu

I'd be surprised if there wasn't something possible for Word, though.

4
  • 2
    Working with multiple documents is not a strength of Word ...
    – nohillside
    Commented Aug 8 at 10:00
  • Based on this suggestion I've used BBEdit to F+R multiple IDs. Thank you! Unfortunately, for some reason, other IDs are not correctly searched/replaced, either in errors cropping up in the search process, or claiming success, but manual searching finding additional examples (this taking into account case sensitivity, whitespace, exact match). I think somehow .docx formatting creates a problem for the search, possibly via highlighting, paragraph formatting, or something else. So this is a partial answer and got the upvote, but will wait to mark solution pending other answers.
    – Gryph
    Commented Aug 8 at 11:40
  • @Gryph You can't use BBEdit to search .docx files, if that's what you mean. Also, it should be pretty solid. Do the IDs have characters that might be mistaken for wildcards or grep commands?
    – benwiggy
    Commented Aug 8 at 13:04
  • @benwiggy I did use it to search, find + replace across my set of docx, using the same instructions you provided above, so it does work.. though imperfectly. I'm really not sure why in some instances it correctly identified + replaced e.g. 'Mary Poppins' but in other instances it didn't. In almost all instances it didn't work, it did identify some instances in the same file - just not all of them. It worked correctly about 70% of the time, which is better then where I was when I started, so thanks again!
    – Gryph
    Commented Aug 9 at 14:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .