Office.MailboxEnums.SourceProperty enum

指定项目中所选数据的源, (有关详细信息,请参阅 Office.mailbox.item.getSelectedDataAsync) 。

注解

[ API set: Mailbox 1.2 ]

适用的 Outlook 模式:撰写

示例

// 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"

数据源来自项的正文。

Subject = "subject"

数据源来自项目的主题。