<img src="https://solution-community.wps.cn/uploads/post/4TsqfpWJDo1.png" alt="image.png"/>
<img src="https://solution-community.wps.cn/uploads/post/4TsqYBvft6S.png" alt="image.png"/>
光标不一定在文档最末尾,截图只是为了测试随便写的
<img src="https://solution-community.wps.cn/uploads/post/4TsqfpWJDo1.png" alt="image.png"/>
<img src="https://solution-community.wps.cn/uploads/post/4TsqYBvft6S.png" alt="image.png"/>
光标不一定在文档最末尾,截图只是为了测试随便写的
使用选区接口拿到了 https://solution.wps.cn/docs/client/api/Word/Selection.html#range
const range = await app.ActiveDocument.ActiveWindow.Selection.Range
console.log(await range.Start)