Microsoft Teams Blog articles

Add a Range API for Outlook add-ins

Word add-ins provide the Word.Range API, which allows precise manipulation of document content (selection, insertion, replacement, formatting). Outlook add-ins currently lack an equivalent API, making fine-grained interaction with the message body difficult or impossible.   We propose adding a Range-like API for Outlook add-ins to enable: • Access to the current selection in the message body • Insert or replace text at a specific position   This would significantly improve advanced authoring, productivity, and AI-assisted scenarios in Outlook.   Example (conceptual)const range = Outlook.context.mailbox.item.getSelectedRange(); range.insertText("Hello world", Outlook.InsertLocation.replace);   Reference Word Range API : https://learn.microsoft.com/en-us/javascript/api/word/word.range?view=word-js-preview
favicon
techcommunity.microsoft.com
techcommunity.microsoft.com
Create attached notes ...