Office.AttachmentDetails interface

Represents an attachment on an item from the server. Read mode only.

An array of AttachmentDetails objects is returned as the attachments property of an appointment or message item.

[ API set: Mailbox 1.1 ]

Remarks

Minimum permission level: ReadItem

Applicable Outlook mode: Read

Examples

// The following code builds an HTML string with details
// of all attachments on the current item.
var item = Office.context.mailbox.item;
var outputString = "";

if (item.attachments.length > 0) {
    for (i = 0 ; i < item.attachments.length ; i++) {
        var attachment = item.attachments[i];
        outputString += "<BR>" + i + ". Name: ";
        outputString += attachment.name;
        outputString += "<BR>ID: " + attachment.id;
        outputString += "<BR>contentType: " + attachment.contentType;
        outputString += "<BR>size: " + attachment.size;
        outputString += "<BR>attachmentType: " + attachment.attachmentType;
        outputString += "<BR>isInline: " + attachment.isInline;
    }
}

console.log(outputString);

Properties

attachmentType

Gets a value that indicates the type of an attachment.

contentType

Gets the MIME content type of the attachment.

id

Gets the Exchange attachment ID of the attachment. However, if the attachment type is MailboxEnums.AttachmentType.Cloud, then a URL for the file is returned.

isInline

Gets a value that indicates whether the attachment should be displayed in the body of the item.

name

Gets the name of the attachment.

Important: For message or appointment items that were attached by drag-and-drop or "Attach Item", name includes a file extension in Outlook on Mac, but excludes the extension on the web or Windows.

size

Gets the size of the attachment in bytes.

Property Details

attachmentType

Gets a value that indicates the type of an attachment.

attachmentType: MailboxEnums.AttachmentType | string;

Property Value

contentType

Gets the MIME content type of the attachment.

contentType: string;

Property Value

string

id

Gets the Exchange attachment ID of the attachment. However, if the attachment type is MailboxEnums.AttachmentType.Cloud, then a URL for the file is returned.

id: string;

Property Value

string

isInline

Gets a value that indicates whether the attachment should be displayed in the body of the item.

isInline: boolean;

Property Value

boolean

name

Gets the name of the attachment.

Important: For message or appointment items that were attached by drag-and-drop or "Attach Item", name includes a file extension in Outlook on Mac, but excludes the extension on the web or Windows.

name: string;

Property Value

string

size

Gets the size of the attachment in bytes.

size: number;

Property Value

number