在 JS Word 中获取从指针到文档末尾的文本 api

Getting text from the pointer till the end of the document in JS Word api

如何获取从光标当前位置到文件末尾的范围内的文本?我用JavaScript字api.

找到解决方案:

const doc = context.document;
const originalRange = doc.getSelection();
originalRange.load("text");
await context.sync();

var txt = originalRange.text;