File tree Expand file tree Collapse file tree 2 files changed +25
-7
lines changed Expand file tree Collapse file tree 2 files changed +25
-7
lines changed Original file line number Diff line number Diff line change 3
3
* See LICENSE in the project root for license information.
4
4
*/
5
5
6
- ( ( ) => {
7
- // The initialize function must be run each time a new page is loaded
8
- Office . initialize = ( ) => {
6
+ Office . onReady ( info => {
7
+ // If needed, Office.js is ready to be called
8
+ } ) ;
9
9
10
- } ;
10
+ /**
11
+ * Shows a notification when the add-in command is executed.
12
+ * @param event
13
+ */
14
+ function action ( event : Office . AddinCommands . Event ) {
15
+ // Your code goes here
16
+
17
+ // Be sure to indicate when the add-in command function is complete
18
+ event . completed ( ) ;
19
+ }
20
+
21
+ function getGlobal ( ) {
22
+ return ( typeof self !== "undefined" ) ? self :
23
+ ( typeof window !== "undefined" ) ? window :
24
+ ( typeof global !== "undefined" ) ? global :
25
+ undefined ;
26
+ }
27
+
28
+ const g = getGlobal ( ) as any ;
11
29
12
- // Add any ui-less function here
13
- } ) ( ) ;
30
+ // the add-in command functions need to be available in global scope
31
+ g . action = action ;
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ module.exports = async (env, options) => {
77
77
"Access-Control-Allow-Origin" : "*"
78
78
} ,
79
79
https : await devCerts . getHttpsServerOptions ( ) ,
80
- port : 3000
80
+ port : 3000 ,
81
81
}
82
82
} ;
83
83
You can’t perform that action at this time.
0 commit comments