-
Notifications
You must be signed in to change notification settings - Fork 0
/
myscript.js
53 lines (42 loc) · 1.6 KB
/
myscript.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
(function () {
'use strict';
// The Office initialize function must be run each time a new page is loaded
Office.initialize = function (reason) {
$(document).ready(function () {
console.log("initializing");
app.initialize();
getTaskSuggestions();
});
};
function getTaskSuggestions() {
var entities = Office.context.mailbox.item.getEntities();
var tasksArray = entities.taskSuggestions;
var htmlText = "";
console.log("getTaskSuggestions, length of array: " + tasksArray.length);
// Iterates through each instance of a task suggestion.
for (var i = 0; i < tasksArray.length; i++)
{
// Gets the string that was identified as a task suggestion.
htmlText += "TaskString : <span>" +
tasksArray[i].taskString + "</span><br/>";
// Gets an array of assignees for that instance of a task
// suggestion. Each assignee is represented by an
// EmailUser object.
var assigneesArray = tasksArray[i].assignees;
for (var j = 0; j < assigneesArray.length; j++)
{
htmlText += "Assignee : ( ";
// Gets the displayName property of the assignee.
htmlText += "displayName = <span>" + assigneesArray[j].displayName +
"</span> , ";
// Gets the emailAddress property of each assignee.
// This is the SMTP address of the assignee.
htmlText += "emailAddress = <span>" + assigneesArray[j].emailAddress +
"</span>";
htmlText += " )<br/>";
}
htmlText += "<hr/>";
}
document.getElementById("entities_box").innerHTML = htmlText;
}
})();