Office.ReplyFormAttachment interface

A file or item attachment. Used when displaying a reply form.

Remarks

Examples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/55-display-items/display-reply-with-attachments.yaml

// The async version is only available starting with requirement set 1.9.
// It provides a callback when the new appointment form has been created.
Office.context.mailbox.item.displayReplyFormAsync(
  {
    htmlBody: "This is a reply with an inline image and an item attachment.<br><img src='cid:dog.jpg'>",
    attachments: [
      { type: "file", url: "http://i.imgur.com/9S36xvA.jpg", name: "dog.jpg", inLine: true },
      { type: "item", itemId: Office.context.mailbox.item.itemId, name: "test_email.msg" }
    ]
  },
  (asyncResult) => {
    console.log(JSON.stringify(asyncResult));
  }
);

Properties

base64File

The Base64-encoded string of the file to be attached. Only use if type is set to base64.

inLine

If true, indicates that the attachment will be shown inline in the message body and shouldn't be displayed in the attachment list. Only use if type is set to file.

itemId

The EWS item ID of the attachment. This is a string up to 100 characters. Only use if type is set to item.

name

A string that contains the name of the attachment, up to 255 characters in length.

type

Indicates the type of attachment.

url

The URI of the location for the file. Only use if type is set to file.

Important: This link must be publicly accessible without need for authentication by Exchange Online servers. However, with on-premises Exchange, the link can be accessible on a private network as long as it doesn't need further authentication.

Property Details

base64File

The Base64-encoded string of the file to be attached. Only use if type is set to base64.

base64File?: string;

Property Value

string

Remarks

[ API set: Mailbox 1.15 ]

inLine

If true, indicates that the attachment will be shown inline in the message body and shouldn't be displayed in the attachment list. Only use if type is set to file.

inLine?: boolean;

Property Value

boolean

itemId

The EWS item ID of the attachment. This is a string up to 100 characters. Only use if type is set to item.

itemId?: string;

Property Value

string

name

A string that contains the name of the attachment, up to 255 characters in length.

name: string;

Property Value

string

type

Indicates the type of attachment.

type: MailboxEnums.AttachmentType;

Property Value

Remarks

Important:

  • The base64 attachment type was introduced in Mailbox requirement set 1.15. It's only supported by the displayReplyAllForm, displayReplyAllFormAsync, displayReplyForm, and displayReplyFormAsync methods.

  • The cloud attachment type isn't supported by the displayNewMessageForm, displayNewMessageFormAsync, displayReplyAllForm, displayReplyAllFormAsync, displayReplyForm, and displayReplyFormAsync methods.

url

The URI of the location for the file. Only use if type is set to file.

Important: This link must be publicly accessible without need for authentication by Exchange Online servers. However, with on-premises Exchange, the link can be accessible on a private network as long as it doesn't need further authentication.

url?: string;

Property Value

string