officejs
2 TopicsOffice.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!74Views0likes4CommentsUpdate Fields with officejs after changing DocumentProperty
Hi all, I'm looking for some help and I can't find the answer online. I'm building a Word Add-in with officejs 1.3. On this Add-in the user fills-out a form. With the given data I override or add these to CustomDocumentProperties. The 'Fields' on the document is not updatet and keep showing the old data. Even after closing and opening the document. Only when I right-click on the 'Field' and choose for 'Update Field' the updatet value is shown. I can't use Macro's because it has to work on a Mac as well. In VSTO, we can easily update fields of a Word document using c# code: _wordApplication.ActiveDocument.Fields.Update(); But how do I manage this with officejs? Thanks for helping me out! Jeffrey1KViews0likes2Comments