查找替换

根据传入数组全文匹配并替换文本

  1. /*
  2. * @param: { Data: [ key: string, value: string, options: object ] }
  3. * eg: [{key: '被替换的文本', value: '替换的文本', options: { isWildcardMatched: false }}]
  4. * options - 替换配置
  5. * isWildcardMatched: 使用通配符
  6. * isCaseSensitive:区分大小写
  7. * isWholeWordMatched:全字匹配
  8. * isWidthIgnored:忽略全/半角
  9. */
  10. await demo.WordApplication().ActiveDocument.replaceText([{key: '123', value: '234'}])