Office.MailboxEnums.SourceProperty enum
Specifies the source of the selected data in an item (see Office.mailbox.item.getSelectedDataAsync
for details).
Applicable Outlook mode: Compose
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/20-item-body/get-selected-data.yaml
Office.context.mailbox.item.getSelectedDataAsync(Office.CoercionType.Text, function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
const text = asyncResult.value.data;
const prop = asyncResult.value.sourceProperty;
console.log("Selected text in " + prop + ": " + text);
} else {
console.error(asyncResult.error);
}
});
Body = "body" | The source of the data is from the body of the item. |
Subject = "subject" | The source of the data is from the subject of the item. |
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins feedback
Office Add-ins is an open source project. Select a link to provide feedback: