Office.MailboxEnums.AttachmentContentFormat enum

Specifies the formatting that applies to an attachment's content.

Remarks

[ API set: Mailbox 1.8 ]

Applicable Outlook mode: Compose or Read

Examples

// 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);
}

Fields

Base64 = "base64"

The content of the attachment is returned as a base64-encoded string.

Url = "url"

The content of the attachment is returned as a string representing a URL.

Eml = "eml"

The content of the attachment is returned as a string representing an .eml formatted file.

ICalendar = "iCalendar"

The content of the attachment is returned as a string representing an .icalendar formatted file.