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

210 Views Asked by At

How can i get the text in range from the current location of the cursor till the end of the file? I use JavaScript Word api.

1

There are 1 best solutions below

0
On BEST ANSWER

Found a solution:

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

var txt = originalRange.text;