Office.Initialize


Office.initialize Events



Home.html

This html file must call its corresponding javascript file.
This html file must include a reference to Office.js
These functions should use the item.NotificationMessages API to communicate with the user.
These functions should call event.completed
Always include a meta element as a child element of the head element

<html> 
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE-Edge">
<link href="../../Content/Office.css" rel="stylesheet"
      type="text/css"/>

<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"
        type="text/javascript"> </script>

<script src="Home.js"
        type="text/javascript"> </script>
</head>
<body>
   <div class="padding">
      <button class="ms-Button"
            id="button-on-task-pane">Button1</button>
   </div>
</body>
</html>


Home.js

This javascript file must call Office.Initialize.

( function () { 

   Office.initialize = function(reason) {
      $(document).ready(function() {
   
       // Define your event handlers
      $("button-on-taskpane").click(event_ButtonOnTaskpane);
      }
      );
   }
   
   function event_ButtonOnTaskpane(event) {
          event.completed();
   }
   
} ) ();



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

Prev