搜索文字方法 app.ActiveDocument.Find.Execute 内部 error 但是 并没有 返回错误信息 不知道具体什么原因报错

阅读次数 1
    await this.firstJsdk.ready();
    debugger
    let app = this.firstJsdk.Application
      // 1. 搜索并高亮文本
    const findResult = await app.ActiveDocument.Find.Execute('南京', true);
    // 2. 获取位置信息
    const { pos } = findResult[0];
    // 3. 获取区域对象
    const range = await app.ActiveDocument.Range.SetRange(pos, pos);
    // 4. 滚动文档窗口, 显示指定的区域
    await app.ActiveDocument.ActiveWindow.ScrollIntoView(range);
1 Answers