Office.MailboxEnums.AttachmentContentFormat enum

添付ファイルのコンテンツに適用される書式を指定します。

注釈

[ API セット: メールボックス 1.8 ]

適用できる Outlook モード: 新規作成または読み取り

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/40-attachments/get-attachment-content.yaml

function handleAttachmentsCallback(result) {
  // Identifies whether the attachment is a Base64-encoded string, .eml file, .icalendar file, or a URL.
  switch (result.value.format) {
    case Office.MailboxEnums.AttachmentContentFormat.Base64:
      // Handle file attachment.
      console.log("Attachment is a Base64-encoded string.");
      break;
    case Office.MailboxEnums.AttachmentContentFormat.Eml:
      // Handle email item attachment.
      console.log("Attachment is a message.");
      break;
    case Office.MailboxEnums.AttachmentContentFormat.ICalendar:
      // Handle .icalender attachment.
      console.log("Attachment is a calendar item.");
      break;
    case Office.MailboxEnums.AttachmentContentFormat.Url:
      // Handle cloud attachment.
      console.log("Attachment is a cloud attachment.");
      break;
    default:
    // Handle attachment formats that aren't supported.
  }

  console.log(result.value.content);
}

フィールド

Base64 = "base64"

添付ファイルの内容は、base64 でエンコードされた文字列として返されます。

Url = "url"

添付ファイルの内容は、URL を表す文字列として返されます。

Eml = "eml"

添付ファイルの内容は、.eml形式のファイルを表す文字列として返されます。

ICalendar = "iCalendar"

添付ファイルの内容は、.icalendar 形式のファイルを表す文字列として返されます。