Office.TaskSuggestion interface
Represents a suggested task identified in an item. Read mode only.
The list of tasks suggested in an email message is returned in the taskSuggestions
property of the Entities object that's returned when the getEntities
or getEntitiesByType
method is called on the active item.
Warning: Entity-based contextual Outlook add-ins are now retired. However, regular expression rules are still supported. We recommend updating your contextual add-in to use regular expression rules as an alternative solution. For guidance on how to implement these rules, see Contextual Outlook add-ins.
Remarks
Minimum permission level: read item
Applicable Outlook mode: Read
Examples
const item = Office.context.mailbox.item;
// Get an array of strings that represent task suggestions in the current item's body.
const taskSuggestions = item.getEntitiesByType(Office.MailboxEnums.EntityType.TaskSuggestion);
console.log("There are " + taskSuggestions.length + " task suggestions.")
taskSuggestions.forEach(function (taskSuggestion) {
console.log("Assignees: " + JSON.stringify(taskSuggestion.assignees));
console.log("Task: " + JSON.stringify(taskSuggestion.taskString));
});
Properties
assignees | Gets the users that should be assigned a suggested task. Warning: Entity-based contextual Outlook add-ins are now retired. However, regular expression rules are still supported. We recommend updating your contextual add-in to use regular expression rules as an alternative solution. For guidance on how to implement these rules, see Contextual Outlook add-ins. |
task |
Gets the text of an item that was identified as a task suggestion. Warning: Entity-based contextual Outlook add-ins are now retired. However, regular expression rules are still supported. We recommend updating your contextual add-in to use regular expression rules as an alternative solution. For guidance on how to implement these rules, see Contextual Outlook add-ins. |
Property Details
assignees
Gets the users that should be assigned a suggested task.
Warning: Entity-based contextual Outlook add-ins are now retired. However, regular expression rules are still supported. We recommend updating your contextual add-in to use regular expression rules as an alternative solution. For guidance on how to implement these rules, see Contextual Outlook add-ins.
assignees: EmailUser[];
Property Value
taskString
Gets the text of an item that was identified as a task suggestion.
Warning: Entity-based contextual Outlook add-ins are now retired. However, regular expression rules are still supported. We recommend updating your contextual add-in to use regular expression rules as an alternative solution. For guidance on how to implement these rules, see Contextual Outlook add-ins.
taskString: string;
Property Value
string
Office Add-ins