-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i
- Loading branch information
admin
authored and
admin
committed
Sep 16, 2024
0 parents
commit 8d6150f
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!-- 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 'Helloooo world!' in a new message.</p> | ||
<button id="helloButton">Say hellooooo</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 = sayHelloT; | ||
} | ||
}); | ||
|
||
/** | ||
* Writes 'Hello world!' to a new message body. | ||
*/ | ||
function sayHelloT() { | ||
Office.context.mailbox.item.body.setAsync( | ||
"Hello world 8!", | ||
{ | ||
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> |