Document.SelectionChanged event (JavaScript API for Office v1.0)

JavaScript API for Office v1.0

Occurs when the selection in the document is changed.

Last modified: June 12, 2014

Office.EventType.DocumentSelectionChanged

To add an event handler for the SelectionChanged event of a document, use the addHandlerAsync method of the Document object.

function addEventHandlerToDocument() {
    Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged, MyHandler);
}

function MyHandler(eventArgs) {
    doSomethingWithDocument(eventArgs.document);
}

Supported clients

Excel 2013, Excel 2013 RT, Excel Online, Word 2013, Word 2013 RT

Library

Office.js

Namespace

Office

Show:
© 2014 Microsoft