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

JavaScript API for Office v1.1

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);
}

App types

Content apps, Task pane apps

Supported clients

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

Library

Office.js

Namespace

Office

Show:
© 2014 Microsoft