I've found one or two guides to doing a word search and replace across multiple documents with powershell. They work well on simple documents. However, the script ignores text in headers and footers; and if "track changes" is enabled, it replaces text which has already been replaced, resulting in multipl开发者_Python百科e copies of the new text if I run the script more than once on the same file.
Any clues as to how I can avoid these undesirable behaviors and make this script robust?
(reposted from Serverfault).
For replacing text in all parts of a Word document see:
Using a macro to replace text where ever it appears in a document
精彩评论