开发者

Idempotent Powershell word search/replace across documents with headers, change tracking, etc

开发者 https://www.devze.com 2023-02-03 11:41 出处:网络
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;

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

0

精彩评论

暂无评论...
验证码 换一张
取 消