Office.MailboxEnums.AttachmentContentFormat enum

指定应用于附件内容的格式设置。

注解

[ API set: Mailbox 1.8 ]

适用的 Outlook 模式:Compose或读取

示例

// 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 格式文件的字符串返回。