Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Office.DecryptedMessageBody interface

Package:
outlook

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Represents the body of a decrypted message.

Remarks

API set: Mailbox preview

Minimum permission level: read/write item

Applicable Outlook mode: Message Read

To learn how to develop an encryption add-in in Outlook, see Create an encryption Outlook add-in.

Used by

Examples

// This sample handles the OnMessageDecrypt event to decrypt the body and attachments of a message.
function onMessageDecryptHandler(event) {
 // Your code to decrypt the contents of a message would appear here.
 ...

 // Use the results from your decryption process to display the decrypted contents of the message body and attachments.
 const decryptedBodyContent = "<p>Please find attached the recent report and its supporting documentation.</p>";
 const decryptedBody = {
 coercionType: Office.CoercionType.Html,
 content: decryptedBodyContent
 };

 // Decrypted content and properties of a file attachment.
 const decryptedPdfFile = "JVBERi0xLjQKJeLjz9MKNCAwIG9i...";
 const pdfFileName = "Fabrikam_Report_202509";

 // Decrypted properties of a cloud attachment.
 const cloudFilePath = "https://contosostorage.com/reports/weekly_forecast.xlsx";
 const cloudFileName = "weekly_forecast.xlsx";

 // Decrypted content and properties of an inline image.
 const decryptedImageFile = "iVBORw0KGgoAAAANSUhEUgAA...";
 const imageFileName = "banner.png";
 const imageContentId = "image001.png@01DC1DD9.1A4AA300";

 const decryptedAttachments = [
 {
 attachmentType: Office.MailboxEnums.AttachmentType.File,
 content: decryptedPdfFile,
 isInline: false,
 name: pdfFileName
 },
 {
 attachmentType: Office.MailboxEnums.AttachmentType.Cloud,
 isInline: false,
 name: cloudFileName,
 path: cloudFilePath
 },
 {
 attachmentType: Office.MailboxEnums.AttachmentType.File,
 content: decryptedImageFile,
 contentId: imageContentId,
 isInline: true,
 name: imageFileName
 }
 ];

 event.completed(
 {
 allowEvent: true,
 emailBody: decryptedBody,
 attachments: decryptedAttachments,
 contextData: { messageType: "ReplyFromDecryptedMessage" }
 }
 );
}

Properties

coercionType

Specifies the format of the body of a message. The body of a message can be formatted as Office.CoercionType.Html or Office.CoercionType.Text.

content

Specifies the content displayed in the body of the message.

Property Details

coercionType

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Specifies the format of the body of a message. The body of a message can be formatted as Office.CoercionType.Html or Office.CoercionType.Text.

coercionType: Office.CoercionType;

Property Value

Remarks

API set: Mailbox preview

Minimum permission level: read/write item

Applicable Outlook mode: Message Read

content

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Specifies the content displayed in the body of the message.

content: string;

Property Value

string

Remarks

API set: Mailbox preview

Minimum permission level: read/write item

Applicable Outlook mode: Message Read


Feedback

Was this page helpful?