Forum Discussion
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.
However, when I use:
context.document.getSelection()
It only returns a single Word.Range, and I couldn't find any API to detect or retrieve all the selected ranges.
I came across this related discussion:
Microsoft Tech Community – Support for Retrieving Multiple Selected Ranges in Word via Office.js
My questions are:
1. As of 2026, is there any supported Office.js API to retrieve multiple non-contiguous text selections?
2. Is there any workaround to detect that the user has selected multiple ranges?
3. Or is this still a platform limitation?
Our use case is an AI-powered legal research add-in, where users may want to select multiple clauses from different parts of a document and send them together as context.
Any guidance would be appreciated. Thanks!
1 Reply
Select the first block of text and then while holding down the CTRL key, left click and drag from the beginning to the end of any subsequent blocks of text that you want to select. Below is a screen shot of that application of that procedure:
In the case of multiple words, instead of left clicking and dragging with the CTRL key held down, you can double left click with the mouse with the CTRL key held down and likewise for selecting a complete paragraph, you can triple left click with the mouse.