Export (0) Print
Expand All

Appointment.addFileAttachmentAsync method (JavaScript API for Office v1.1)

JavaScript API for Office v1.1

Adds a file to an appointment as an attachment. This method was introduced in version 1.1.

Last modified: June 26, 2014

Applicable Outlook modes

Compose

Available in requirement sets

Mailbox

Office.context.mailbox.item.addFileAttachmentAsync(uri, attachmentName[, options], callback);

uri

The URI that provides the location of the file to attach to the appointment. The maximum length is 2048 characters. Required.

attachmentName

The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters. Required.

options

Any optional parameters or state data passed to the method. Optional.

callback

The method to invoke when the attachment finishes uploading. Optional.

The addFileAttachmentAsync method uploads the file at the specified URI and attaches it to the appointment in the compose form. If you specify a callback method, the method will be called with one parameter, asyncResult, which contains either the identifier of the attachment or a code that indicates any error uploading the attachment. You can use the options parameter to pass state information to the callback method if needed.

You can subsequently use the identifier with the removeAttachmentAsync method to remove the attachment in the same session.

If the attachment fails to upload, the asyncResult object will contain an Error object that provides a description of the error.

Error code

Description

AttachmentSizeExceeded

The attachment is larger than allowed.

FileTypeNotSupported

The attachment has an extension that is not allowed.

NumberOfAttachmentsExceeded

The appointment contains too many attachments.

App types

Mail app

Supported clients

Outlook 2013 SP1, Outlook 2013 RT, Outlook Web App, and OWA for Devices

Library

Office.js

Namespace

Office

Show:
© 2014 Microsoft