diff --git a/outllook_pal_toolsWeb/commands.js b/outllook_pal_toolsWeb/commands.js
index 1b046c1..3622456 100644
--- a/outllook_pal_toolsWeb/commands.js
+++ b/outllook_pal_toolsWeb/commands.js
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
* See LICENSE in the project root for license information.
*/
@@ -9,39 +9,44 @@ Office.onReady(() => {
// If needed, Office.js is ready to be called
});
-/**
- * Writes the event source id to the document when ExecuteFunction runs.
- * @param event {Office.AddinCommands.Event}
- */
+async function writeInviteIta(event) {
+ Office.context.mailbox.item.body.setAsync(
+ "
Google ITA",
+ {
+ coercionType: "html", // Write text as HTML
+ },
-async function writeValue(event) {
- Word.run(async (context) => {
- // insert a paragraph at the end of the document.
- const paragraph = context.document.body.insertParagraph(
- "ExecuteFunction works. Button ID=" + event.source.id,
- Word.InsertLocation.end
- );
+ // Callback method to check that setAsync succeeded
+ function (asyncResult) {
+ if (asyncResult.status ==
+ Office.AsyncResultStatus.Failed) {
+ write(asyncResult.error.message);
+ }
+ }
+ );
- // change the paragraph color to blue.
- paragraph.font.color = "blue";
-
- await context.sync();
- });
-
- // Calling event.completed is required. event.completed lets the platform know that processing has completed.
event.completed();
}
-function getGlobal() {
- return typeof self !== "undefined"
- ? self
- : typeof window !== "undefined"
- ? window
- : typeof global !== "undefined"
- ? global
- : undefined;
+async function writeInviteEng(event) {
+ Office.context.mailbox.item.body.setAsync(
+ "
Google Eng",
+ {
+ coercionType: "html", // Write text as HTML
+ },
+
+ // Callback method to check that setAsync succeeded
+ function (asyncResult) {
+ if (asyncResult.status ==
+ Office.AsyncResultStatus.Failed) {
+ write(asyncResult.error.message);
+ }
+ }
+ );
+
+ event.completed();
}
-const g = getGlobal();
+Office.actions.associate("writeInviteIta", writeInviteIta);
-Office.actions.associate("writeValue", writeValue);
\ No newline at end of file
+Office.actions.associate("writeInviteEng", writeInviteEng);
\ No newline at end of file