52 lines
1.4 KiB
JavaScript
52 lines
1.4 KiB
JavaScript
/*
|
|
* Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
* See LICENSE in the project root for license information.
|
|
*/
|
|
|
|
/* global global, Office, self, window, Word */
|
|
|
|
Office.onReady(() => {
|
|
// If needed, Office.js is ready to be called
|
|
});
|
|
|
|
async function writeInviteIta(event) {
|
|
Office.context.mailbox.item.body.setAsync(
|
|
"<a href=\"www.google.com\">Google ITA</a>",
|
|
{
|
|
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();
|
|
}
|
|
|
|
async function writeInviteEng(event) {
|
|
Office.context.mailbox.item.body.setAsync(
|
|
"<a href=\"www.google.com\">Google Eng</a>",
|
|
{
|
|
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();
|
|
}
|
|
|
|
Office.actions.associate("writeInviteIta", writeInviteIta);
|
|
|
|
Office.actions.associate("writeInviteEng", writeInviteEng); |