Remove unused files
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
<FormSettings>
|
||||
<Form xsi:type="ItemRead">
|
||||
<DesktopSettings>
|
||||
<SourceLocation DefaultValue="~remoteAppUrl/taskpane.html"/>
|
||||
<SourceLocation DefaultValue="~remoteAppUrl/Functions/Commands.html"/>
|
||||
<RequestedHeight>250</RequestedHeight>
|
||||
</DesktopSettings>
|
||||
</Form>
|
||||
@@ -131,7 +131,7 @@
|
||||
<bt:Image id="PAL.flag_en_80x80" DefaultValue="~remoteAppUrl/Images/Flag_En_Icon80.png" />
|
||||
</bt:Images>
|
||||
<bt:Urls>
|
||||
<bt:Url id="Commands.Url" DefaultValue="~remoteAppUrl/commands.html" />
|
||||
<bt:Url id="Commands.Url" DefaultValue="~remoteAppUrl/Functions/Commands.html" />
|
||||
</bt:Urls>
|
||||
<!-- ShortStrings max characters==125. -->
|
||||
<bt:ShortStrings>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
|
||||
<!-- Office JavaScript API -->
|
||||
<script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js"></script>
|
||||
|
||||
<script type="text/javascript" src="commands.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,14 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<title></title>
|
||||
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js" type="text/javascript"></script>
|
||||
<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"></script>
|
||||
<script src="FunctionFile.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- NOTA: il corpo è intenzionalmente vuoto. Dal momento che viene richiamato tramite un pulsante, non esiste interfaccia utente di cui eseguire il rendering. -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
});
|
||||
|
||||
/**
|
||||
* Writes the event source id to the document when ExecuteFunction runs.
|
||||
* @param event {Office.AddinCommands.Event}
|
||||
*/
|
||||
|
||||
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
|
||||
);
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
const g = getGlobal();
|
||||
|
||||
Office.actions.associate("writeValue", writeValue);
|
||||
|
||||
//Office.initialize = function () {
|
||||
//}
|
||||
|
||||
//// Funzione helper per aggiungere un messaggio di stato alla barra informazioni.
|
||||
//function statusUpdate(icon, text) {
|
||||
// Office.context.mailbox.item.notificationMessages.replaceAsync("status", {
|
||||
// type: "informationalMessage",
|
||||
// icon: icon,
|
||||
// message: text,
|
||||
// persistent: false
|
||||
// });
|
||||
//}
|
||||
|
||||
//function defaultStatus(event) {
|
||||
// statusUpdate("icon16" , "Hello World!");
|
||||
//}
|
||||
@@ -1,5 +0,0 @@
|
||||
/*Stile specifico della pagina */
|
||||
|
||||
.padding {
|
||||
padding: 15px;
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<title></title>
|
||||
<script src="Scripts/jquery-3.6.0.js" type="text/javascript"></script>
|
||||
|
||||
<!-- Per altre informazioni sulle API JavaScript per Office, vedere https://aka.ms/officejs-overview. -->
|
||||
<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"></script>
|
||||
|
||||
<!-- Per abilitare il debug offline con un riferimento locale a Office.js, usare: -->
|
||||
<!-- <script src="Scripts/Office/MicrosoftAjax.js" type="text/javascript"></script> -->
|
||||
<!-- <script src="Scripts/Office/1/office.js" type="text/javascript"></script> -->
|
||||
|
||||
<script src="MessageRead.js" type="text/javascript"></script>
|
||||
<script src="Scripts/MessageBanner.js" type="text/javascript"></script>
|
||||
<link href="Content/Button.css" rel="stylesheet" type="text/css" />
|
||||
<link href="Content/MessageBanner.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
|
||||
<!-- Per altre informazioni su Office UI Fabric Core, vedere https://aka.ms/office-ui-fabric. -->
|
||||
<link rel="stylesheet" href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-core/9.6.0/css/fabric.min.css">
|
||||
|
||||
<!-- Per abilitare l'uso offline di Office UI Fabric Core, usare: -->
|
||||
<!-- link rel="stylesheet" href="Content/fabric.min.css" -->
|
||||
|
||||
<!-- Office UI Fabric JS e i relativi componenti non sono più supportati attivamente. Per i modelli e le procedure consigliate, vedere https://aka.ms/PnP-OfficeFabricReact -->
|
||||
<!-- <link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/2.1.0/fabric.components.min.css" /> -->
|
||||
|
||||
</head>
|
||||
<body class="ms-Fabric" dir="ltr">
|
||||
<p>Questo esempio di add-in per Outlook visualizza le proprietà dell'elemento selezionato. Zio No No No</p>
|
||||
<div id="content-header">
|
||||
<div class="padding">
|
||||
<p class="ms-font-xl ms-fontColor-themeDarkAlt ms-fontWeight-semilight">All properties</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content-main" class="ms-Grid" dir="ltr">
|
||||
<div class="ms-Grid-row">
|
||||
<div class="ms-Grid-col ms-sm12">
|
||||
<h2 class="ms-font-l">Office.context.mailbox.Item properties</h2>
|
||||
<div class="ms-Grid" dir="ltr">
|
||||
<div class="ms-Grid-row">
|
||||
<div class="ms-Grid-col ms-sm5">Property</div>
|
||||
<div class="ms-Grid-col ms-sm7">Value</div>
|
||||
</div>
|
||||
<div class="ms-Grid-row">
|
||||
<div class="ms-Grid-col ms-fontWeight-semibold ms-sm5">dateTimeCreated</div>
|
||||
<div id="dateTimeCreated" class="ms-Grid-col ms-sm7"></div>
|
||||
</div>
|
||||
<div class="ms-Grid-row">
|
||||
<div class="ms-Grid-col ms-fontWeight-semibold ms-sm5">dateTimeModified</div>
|
||||
<div id="dateTimeModified" class="ms-Grid-col ms-sm7"></div>
|
||||
</div>
|
||||
<div class="ms-Grid-row">
|
||||
<div class="ms-Grid-col ms-fontWeight-semibold ms-sm5">itemClass</div>
|
||||
<div id="itemClass" class="ms-Grid-col ms-sm7"></div>
|
||||
</div>
|
||||
<div class="ms-Grid-row">
|
||||
<div class="ms-Grid-col ms-fontWeight-semibold ms-sm5">itemId</div>
|
||||
<div id="itemId" class="ms-Grid-col ms-sm7"></div>
|
||||
</div>
|
||||
<div class="ms-Grid-row">
|
||||
<div class="ms-Grid-col ms-fontWeight-semibold ms-sm5">itemType</div>
|
||||
<div id="itemType" class="ms-Grid-col ms-sm7"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="message-props" class="ms-Grid-row hidden">
|
||||
<div class="ms-Grid-col ms-sm12 ms-md12 ms-lg12">
|
||||
<h2 class="ms-font-l">Office.context.mailbox.Message properties</h2>
|
||||
<div class="ms-Grid" dir="ltr">
|
||||
<div class="ms-Grid-row">
|
||||
<span class="ms-Grid-col ms-sm5">Property</span>
|
||||
<span class="ms-Grid-col ms-sm7">Value</span>
|
||||
</div>
|
||||
<div class="ms-Grid-row">
|
||||
<span class="ms-Grid-col ms-fontWeight-semibold ms-sm5">attachments</span>
|
||||
<span id="attachments" class="ms-Grid-col ms-sm7"></span>
|
||||
</div>
|
||||
<div class="ms-Grid-row">
|
||||
<span class="ms-Grid-col ms-fontWeight-semibold ms-sm5">cc</span>
|
||||
<span id="cc" class="ms-Grid-col ms-sm7"></span>
|
||||
</div>
|
||||
<div class="ms-Grid-row">
|
||||
<span class="ms-Grid-col ms-fontWeight-semibold ms-sm5">conversationId</span>
|
||||
<span id="conversationId" class="ms-Grid-col ms-sm7"></span>
|
||||
</div>
|
||||
<div class="ms-Grid-row">
|
||||
<span class="ms-Grid-col ms-fontWeight-semibold ms-sm5">from</span>
|
||||
<span id="from" class="ms-Grid-col ms-sm7"></span>
|
||||
</div>
|
||||
<div class="ms-Grid-row">
|
||||
<span class="ms-Grid-col ms-fontWeight-semibold ms-sm5">internetMessageId</span>
|
||||
<span id="internetMessageId" class="ms-Grid-col ms-sm7"></span>
|
||||
</div>
|
||||
<div class="ms-Grid-row">
|
||||
<span class="ms-Grid-col ms-fontWeight-semibold ms-sm5">normalizedSubject</span>
|
||||
<span id="normalizedSubject" class="ms-Grid-col ms-sm7"></span>
|
||||
</div>
|
||||
<div class="ms-Grid-row">
|
||||
<span class="ms-Grid-col ms-fontWeight-semibold ms-sm5">sender</span>
|
||||
<span id="sender" class="ms-Grid-col ms-sm7"></span>
|
||||
</div>
|
||||
<div class="ms-Grid-row">
|
||||
<span class="ms-Grid-col ms-fontWeight-semibold ms-sm5">subject</span>
|
||||
<span id="subject" class="ms-Grid-col ms-sm7"></span>
|
||||
</div>
|
||||
<div class="ms-Grid-row">
|
||||
<span class="ms-Grid-col ms-fontWeight-semibold ms-sm5">to</span>
|
||||
<span id="to" class="ms-Grid-col ms-sm7"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Componente usato per la visualizzazione delle notifiche -->
|
||||
<div class="MessageBanner" style="position:absolute;bottom: 0;">
|
||||
<div class="MessageBanner-content">
|
||||
<div class="MessageBanner-text">
|
||||
<div class="MessageBanner-clipper">
|
||||
<div class="ms-font-m-plus ms-fontWeight-semibold" id="notificationHeader"></div>
|
||||
<div class="ms-font-m ms-fontWeight-semilight" id="notificationBody"></div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="MessageBanner-expand" style="display:none"><i class="ms-Icon ms-Icon--chevronsDown"></i> </button>
|
||||
<div class="MessageBanner-action"></div>
|
||||
</div>
|
||||
<button class="MessageBanner-close"> <i class="ms-Icon ms-Icon--ChromeClose"></i> </button>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,90 +0,0 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var messageBanner;
|
||||
|
||||
// La funzione di inizializzazione di Office deve essere eseguita ogni volta che viene caricata una nuova pagina.
|
||||
Office.initialize = function (reason) {
|
||||
$(document).ready(function () {
|
||||
var element = document.querySelector('.MessageBanner');
|
||||
messageBanner = new components.MessageBanner(element);
|
||||
messageBanner.hideBanner();
|
||||
loadProps();
|
||||
});
|
||||
};
|
||||
|
||||
// Accetta una matrice di oggetti AttachmentDetails e crea un elenco di nomi di allegato separati da un'interruzione di riga.
|
||||
function buildAttachmentsString(attachments) {
|
||||
if (attachments && attachments.length > 0) {
|
||||
var returnString = "";
|
||||
|
||||
for (var i = 0; i < attachments.length; i++) {
|
||||
if (i > 0) {
|
||||
returnString = returnString + "<br/>";
|
||||
}
|
||||
returnString = returnString + attachments[i].name;
|
||||
}
|
||||
|
||||
return returnString;
|
||||
}
|
||||
|
||||
return "None";
|
||||
}
|
||||
|
||||
// Consente di formattare un oggetto EmailAddressDetails come
|
||||
// Nome Cognome <indirizzo di posta elettronica>
|
||||
function buildEmailAddressString(address) {
|
||||
return address.displayName + " <" + address.emailAddress + ">";
|
||||
}
|
||||
|
||||
// Accetta una matrice di oggetti EmailAddressDetails e
|
||||
// crea un elenco di stringhe formattate separate da un'interruzione di riga
|
||||
function buildEmailAddressesString(addresses) {
|
||||
if (addresses && addresses.length > 0) {
|
||||
var returnString = "";
|
||||
|
||||
for (var i = 0; i < addresses.length; i++) {
|
||||
if (i > 0) {
|
||||
returnString = returnString + "<br/>";
|
||||
}
|
||||
returnString = returnString + buildEmailAddressString(addresses[i]);
|
||||
}
|
||||
|
||||
return returnString;
|
||||
}
|
||||
|
||||
return "None";
|
||||
}
|
||||
|
||||
// Carica prima le proprietà dall'oggetto di base Item e quindi
|
||||
// le proprietà specifiche del messaggio.
|
||||
function loadProps() {
|
||||
var item = Office.context.mailbox.item;
|
||||
|
||||
$('#dateTimeCreated').text(item.dateTimeCreated.toLocaleString());
|
||||
$('#dateTimeModified').text(item.dateTimeModified.toLocaleString());
|
||||
$('#itemClass').text(item.itemClass);
|
||||
$('#itemId').text(item.itemId);
|
||||
$('#itemType').text(item.itemType);
|
||||
|
||||
$('#message-props').show();
|
||||
|
||||
$('#attachments').html(buildAttachmentsString(item.attachments));
|
||||
$('#cc').html(buildEmailAddressesString(item.cc));
|
||||
$('#conversationId').text(item.conversationId);
|
||||
$('#from').html(buildEmailAddressString(item.from));
|
||||
$('#internetMessageId').text(item.internetMessageId);
|
||||
$('#normalizedSubject').text(item.normalizedSubject);
|
||||
$('#sender').html(buildEmailAddressString(item.sender));
|
||||
$('#subject').text(item.subject);
|
||||
$('#to').html(buildEmailAddressesString(item.to));
|
||||
}
|
||||
|
||||
// Funzione helper per la visualizzazione delle notifiche
|
||||
function showNotification(header, content) {
|
||||
$("#notificationHeader").text(header);
|
||||
$("#notificationBody").text(content);
|
||||
messageBanner.showBanner();
|
||||
messageBanner.toggleExpansion();
|
||||
}
|
||||
})();
|
||||
@@ -1,42 +0,0 @@
|
||||
<!--<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />-->
|
||||
<!-- Office JavaScript API -->
|
||||
<!--<script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../node_modules/jquery/dist/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../node_modules/showdown/dist/showdown.min.js"></script>
|
||||
<script type="text/javascript" src="../../node_modules/urijs/src/URI.min.js"></script>
|
||||
<script type="text/javascript" src="../helpers/addin-config.js"></script>
|
||||
<script type="text/javascript" src="../helpers/gist-api.js"></script>
|
||||
</head>
|
||||
|
||||
<body>-->
|
||||
<!-- NOTE: The body is empty on purpose. Since functions in commands.js are
|
||||
invoked via a button, there is no UI to render. -->
|
||||
<!--</body>
|
||||
|
||||
</html>-->
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
|
||||
<!-- Office JavaScript API -->
|
||||
<script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js"></script>
|
||||
|
||||
<script type="text/javascript" src="commands.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -68,7 +68,7 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="commands.html" />
|
||||
<Content Include="Functions\Commands.html" />
|
||||
<Content Include="Content\Button.css" />
|
||||
<Content Include="Content\fabric-9.6.0.scoped.css" />
|
||||
<Content Include="Content\fabric-9.6.0.scoped.min.css" />
|
||||
@@ -108,8 +108,6 @@
|
||||
<Content Include="Content\sass\Fabric.scss" />
|
||||
<Content Include="Content\sass\Fabric.Scoped.scss" />
|
||||
<None Include="Scripts\jquery-3.6.0.intellisense.js" />
|
||||
<Content Include="Functions\FunctionFile.html" />
|
||||
<Content Include="Functions\FunctionFile.js" />
|
||||
<Content Include="Images\Close.png" />
|
||||
<Content Include="Images\Flag_En_Icon16.png" />
|
||||
<Content Include="Images\Flag_En_Icon32.png" />
|
||||
@@ -123,10 +121,7 @@
|
||||
<Content Include="Images\Icon32.png" />
|
||||
<Content Include="Images\Icon64.png" />
|
||||
<Content Include="Images\Icon80.png" />
|
||||
<Content Include="MessageRead.css" />
|
||||
<Content Include="MessageRead.html" />
|
||||
<Content Include="MessageRead.js" />
|
||||
<Content Include="commands.js" />
|
||||
<Content Include="Functions\Commands.js" />
|
||||
<Content Include="Scripts\jquery-3.6.0.js" />
|
||||
<Content Include="Scripts\jquery-3.6.0.min.js" />
|
||||
<Content Include="Scripts\jquery-3.6.0.slim.js" />
|
||||
@@ -573,9 +568,6 @@
|
||||
<Content Include="Scripts\Office\metadata\endpoints.xml" />
|
||||
<Content Include="Scripts\Office\metadata\features.xml" />
|
||||
<Content Include="Scripts\Office\MicrosoftAjax.js" />
|
||||
<Content Include="taskpane.css" />
|
||||
<Content Include="taskpane.html" />
|
||||
<Content Include="taskpane.js" />
|
||||
<Content Include="Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
* See LICENSE in the project root for license information.
|
||||
*/
|
||||
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ms-welcome__header {
|
||||
padding: 20px;
|
||||
padding-bottom: 30px;
|
||||
padding-top: 100px;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
-webkit-flex-direction: column;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.ms-welcome__main {
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
-webkit-flex-direction: column;
|
||||
flex-direction: column;
|
||||
-webkit-flex-wrap: nowrap;
|
||||
flex-wrap: nowrap;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
-webkit-flex: 1 0 0;
|
||||
flex: 1 0 0;
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
.ms-welcome__main > h2 {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ms-welcome__features {
|
||||
list-style-type: none;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.ms-welcome__features.ms-List .ms-ListItem {
|
||||
padding-bottom: 20px;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.ms-welcome__features.ms-List .ms-ListItem > .ms-Icon {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.ms-welcome__action.ms-Button--hero {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.ms-Button.ms-Button--hero .ms-Button-label {
|
||||
color: #0078d7;
|
||||
}
|
||||
|
||||
.ms-Button.ms-Button--hero:hover .ms-Button-label,
|
||||
.ms-Button.ms-Button--hero:focus .ms-Button-label {
|
||||
color: #005a9e;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
b {
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. -->
|
||||
<!--<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>-->
|
||||
<!-- Office JavaScript API -->
|
||||
<!--<script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>This add-in will insert the text 'Hello world!' in a new message.</p>
|
||||
<button id="helloButton">Say hello</button>-->
|
||||
<!-- The following image URL tracks diagnostic data for this sample add-in. Please remove the image tag if you reuse this sample in your own code project. -->
|
||||
<!--<img src="https://pnptelemetry.azurewebsites.net/pnp-officeaddins/samples/outlook-add-in-hello-world-run" />
|
||||
</body>
|
||||
|
||||
<script>
|
||||
|
||||
Office.onReady((info) => {
|
||||
if (info.host === Office.HostType.Outlook) {
|
||||
document.getElementById("helloButton").onclick = sayHello;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Writes 'Hello world!' to a new message body.
|
||||
*/
|
||||
function sayHello() {
|
||||
Office.context.mailbox.item.body.setAsync(
|
||||
"Hello world!",
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</html>-->
|
||||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. -->
|
||||
<!-- This file shows how to design a first-run page that provides a welcome screen to the user about the features of the add-in. -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Contoso Task Pane Add-in</title>
|
||||
|
||||
<!-- Office JavaScript API -->
|
||||
<script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js"></script>
|
||||
|
||||
<!-- For more information on Fluent UI, visit https://developer.microsoft.com/fluentui#/. -->
|
||||
<link rel="stylesheet" href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/css/fabric.min.css" />
|
||||
<link rel="stylesheet" href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/css/fabric.components.min.css" />
|
||||
<script src="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/js/fabric.min.js"></script>
|
||||
|
||||
<!-- Template styles -->
|
||||
<link href="taskpane.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<script type="text/javascript" src="taskpane.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="ms-font-m ms-welcome ms-Fabric">
|
||||
<!-- The following image URL tracks diagnostic data for this sample add-in. Please remove the image tag if you reuse this sample in your own code project. -->
|
||||
<img src="https://pnptelemetry.azurewebsites.net/pnp-officeaddins/samples/word-add-in-commands-run" />
|
||||
|
||||
<header class="ms-welcome__header ms-bgColor-neutralLighter">
|
||||
<img width="90" height="90" src="../../assets/logo-filled.png" alt="Contoso" title="Contoso" />
|
||||
<h1 class="ms-font-su">Welcome</h1>
|
||||
</header>
|
||||
<section id="sideload-msg" class="ms-welcome__main">
|
||||
<h2 class="ms-font-xl">Please sideload your add-in to see app body.</h2>
|
||||
</section>
|
||||
<main id="app-body" class="ms-welcome__main" style="display: none;">
|
||||
<p class="ms-font-l">Choose <b>Hello</b> to create a new paragraph saying "Hello World".</p>
|
||||
<button id="run" class="ms-Button">
|
||||
<span class="ms-Button-label">Hello</span>
|
||||
</button>
|
||||
<p></p>
|
||||
<div>
|
||||
<span class="ms-font-m">To learn more, see <a href="https://learn.microsoft.com/office/dev/add-ins/develop/create-addin-commands" target="_blank">Create add-in commands in your manifest for Excel, PowerPoint, and Word</a></span>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
||||
* See LICENSE in the project root for license information.
|
||||
*/
|
||||
|
||||
/* global document, Office, Word */
|
||||
|
||||
Office.onReady((info) => {
|
||||
if (info.host === Office.HostType.Word) {
|
||||
document.getElementById("sideload-msg").style.display = "none";
|
||||
document.getElementById("app-body").style.display = "flex";
|
||||
document.getElementById("run").onclick = run;
|
||||
}
|
||||
});
|
||||
|
||||
async function run() {
|
||||
return Word.run(async (context) => {
|
||||
/**
|
||||
* Insert your Word code here
|
||||
*/
|
||||
|
||||
// insert a paragraph at the end of the document.
|
||||
const paragraph = context.document.body.insertParagraph("Hello World", Word.InsertLocation.end);
|
||||
|
||||
// change the paragraph color to blue.
|
||||
paragraph.font.color = "blue";
|
||||
|
||||
await context.sync();
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user