Define on dropdown menu, languages for invite

This commit is contained in:
Claudio Boggian
2024-06-24 13:37:07 +02:00
parent 9b3e1a3c35
commit e46c52033d
3 changed files with 59 additions and 103 deletions
-1
View File
@@ -117,7 +117,6 @@
</div>
</div>
</div>
<!-- Componente usato per la visualizzazione delle notifiche -->
<div class="MessageBanner" style="position:absolute;bottom: 0;">
<div class="MessageBanner-content">
+34 -29
View File
@@ -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(
"<a href=\"www.google.com\">Google ITA</a>",
{
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(
"<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();
}
const g = getGlobal();
Office.actions.associate("writeInviteIta", writeInviteIta);
Office.actions.associate("writeValue", writeValue);
Office.actions.associate("writeInviteEng", writeInviteEng);