Forum Discussion
nitika-optimus
Jul 21, 2026Copper Contributor
Office.js: Is there any supported way to retrieve multiple non-contiguous text selections in Word?
Hi everyone, I'm developing a Word Office Add-in using Office.js. In Microsoft Word (Windows Desktop), users can select multiple non-contiguous text ranges by holding Ctrl while selecting text. Ho...
Jul 23, 2026
What do you want to do with the non-contiguous ranges?
You could individually select each range and copy it to another document and then after all of the individual ranges have been selected and copied, select all of that other document.
- nitika-optimusJul 23, 2026Copper Contributor
Our use case requires us to detect the range of text which is selected based on specific user action in a side panel for an Add In that we are creating. The user can initiate deselection of any previously selected passage from the side panel using an indicator that we have created.
We need a mechanism to address that specific selected portion, which may not be the last one selected.