ms-word

Microsoft Word JavaScript API - event handler for text selection in document

Deadly 提交于 2020-12-06 05:35:09
问题 I read JavaScript API for Office and I couldn't find a handler to notify when user select a text in the word document. I am aware that we can copy the selected/highlighted text from document as follow: Word.run(function(context) { let body = context.document.body; // ask for the user selected text let range = context.document.getSelection(); }); This approach is not a registered callback or an event. With this approach I have to request update or to check if user selected anything. Is there

Microsoft Word JavaScript API - event handler for text selection in document

十年热恋 提交于 2020-12-06 05:34:10
问题 I read JavaScript API for Office and I couldn't find a handler to notify when user select a text in the word document. I am aware that we can copy the selected/highlighted text from document as follow: Word.run(function(context) { let body = context.document.body; // ask for the user selected text let range = context.document.getSelection(); }); This approach is not a registered callback or an event. With this approach I have to request update or to check if user selected anything. Is there