Events


ObjectEventTypeDescription
DocumentDocumentSelectionChanged 
BindingBindingSelectionChanged 
 BindingDataChanged 
CustomXMLPartDataNodeDeletedWord only
 DataNodeInsertedWord only
 DataNodeReplacedWord only
SettingsSettingsChanged 
RoamingSettings Outlook only


All the above objects also have the following methods:

addHandlerAsync(eventType, handler [,Options], callback);

subscribes a handler to an event

removeHandlerAsync(eventType, handler [,Options], callback);

unsubscribes a handler from an event


eventType - An EventType enumeration
handler - Either a named or anonymous inline function. You should always use a named function to allow it to be removed.
options - The only available parameter is asyncContxt
callback - The AsyncResult.value is always undefined


Office.EventType.DocumentSelectionChanged

( function () { 

   Office.initialize = function (reason) {
      $(document).ready(function () {
         Office.context.document.addHandlerAsync(
            Office.EventType.DocumentSelectionChanged,
            event_onDocumentSelectionChanged,
            callback_DocumentSelectionChanged
   );
   
   function event_onDocumentSelectionChanged(eventArgs) {
   }

   function callback_DocumentSelectionChanged(result) {
      var dataValue = result.value;
   }

} ) ();


eventArgs Parameter


eventArgs.binding
eventArgs.document



Event Scenarios

All events fall into one of the 4 different categories:
Office.initialize events
Document level selection change events
Bindinglevel selection and data change events
Settings changed events






© 2017 Better Solutions Limited. All Rights Reserved. © 2017 Better Solutions Limited

Next