Find/Replace multiple phrases using Regex in Word VBA

I would like to find and replace (or remove) numerous unneeded HTML tags and other text strings in a document.

  • 2 of many examples: I'd like to replace > with > and replace .*?type="HTML"> with a blank (to remove it).

How can I code this using VBA to find and replace many of these various strings all at once in an elegant and simple fashion?

I found this SO post that suggests how to do this without regex, but I'm not sure how to extend it to incorporate regex. This SO post makes some suggestions for regex, but the VBA code looks different enough that I don't know how to combine the two approaches.



Read more here: https://stackoverflow.com/questions/67374716/find-replace-multiple-phrases-using-regex-in-word-vba

Content Attribution

This content was originally published by theforestecologist at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: