Office.MailboxEnums.SourceProperty enum

項目内の選択したデータのソースを指定します (詳細については、「」を参照)。Office.mailbox.item.getSelectedDataAsync

注釈

[ API セット: メールボックス 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"

データのソースは、アイテムの件名から取得されます。