Message.displayReplyForm method (JavaScript API for Office v1.1)

JavaScript API for Office v1.1

Displays a reply form that includes only the sender of the selected message.

Last modified: June 12, 2014

Applicable Outlook modes

Read

Available in requirement sets

Mailbox

Office.context.mailbox.item.displayReplyForm(htmlBody)

htmlBody

A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB.

In Outlook Web App, the reply form is displayed as a pop-out form in the 3-column view and a pop-up form in the 2- or 1-column view.

If htmlBody exceeds the 32-KB limit, displayReplyForm throws an exception.

The following code example in JavaScript obtains the selected item, checks if the item is a message, and displays a reply form to the sender.

var myOm;
var myItem;

// Initialize runtime.
// The initialize function is required for all apps.
Office.initialize = function () {
    myOm = Office.context.mailbox;
    // Get the selected item.
    myItem = myOm.item;

    // Checks for the DOM to load using the jQuery ready function.
    $(document).ready(function () {
        // After the DOM is loaded, app-specific code can run.
        displayReply();
    });
}

function displayReply()
{
    // Display a reply form to the sender only 
    // if the selected item is a message.
    if (myitem.itemType == Office.MailboxEnums.ItemType.Message)
    {
        myItem.displayReplyForm
        ("<html><head><head><body>This is the body of the email reply.</body></html>");
    }
}

App types

Mail app

Supported clients

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

Library

Office.js

Namespace

Office

Show:
© 2014 Microsoft