Export (0) Print
Expand All

Mailbox.displayNewAppointmentForm method (JavaScript API for Office v1.1)

JavaScript API for Office v1.1

Displays a form for creating a new calendar appointment.

Last modified: June 12, 2014

Applicable Outlook modes

Compose or read

Available in requirement sets

Mailbox

Office.context.mailbox.displayNewAppointmentForm({
requiredAttendees,
optionalAttendees,
start,
end,
location,
resources,
subject,
body})

requiredAttendees

An array of strings containing the email addresses or an array containing an EmailAddressDetails object for each of the required attendees for the appointment. The array is limited to a maximum of 100 entries.

optionalAttendees

An array of strings containing the email addresses or an array containing an EmailAddressDetails object for each of the optional attendees for the appointment. The array is limited to a maximum of 100 entries.

start

A Date object specifying the start date and time of the appointment.

end

A Date object specifying the end date and time of the appointment.

location

A string containing the location of the appointment. The string is limited to a maximum of 255 characters.

resources

An array of strings containing the resources required for the appointment. The array is limited to a maximum of 100 entries.

subject

A string containing the subject of the appointment. The string is limited to a maximum of 255 characters.

body

The body of the appointment message. The body content is limited to a maximum size of 32 KB.

The displayNewAppointmentForm method opens a form that enables the user to create a new appointment or meeting. If parameters are specified, the appointment form fields are automatically populated with the contents of the parameters.

In Outlook Web App and OWA for Devices, this method always displays a form with an attendees field. If you do not specify any attendees as input arguments, the method displays a form with a SAVE button. If you have specified attendees, the form would include the attendees and a SEND button.

In the Outlook 2013 rich client, this method displays by default an appointment form with a Save and Close button but without the attendees field. The user can choose Invite Attendees to see any specified attendees and a Send button.

If any of the parameters exceed the specified size limits, or if an unknown parameter name is specified, an exception is thrown.

The following code example in JavaScript sets up the parameters and displays a form for a new appointment.

var myOm;

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

    // Checks for the DOM to load using the jQuery ready function.
    $(document).ready(function () {
        // After the DOM is loaded, can display content in app UI.
        displayFormForNewAppointment();
    });
}
function displayFormForNewAppointment()
{
    var formParameters =
    {
        "requiredAttendees" : ["wendy@contoso.com", "derek@contoso.com"],
        "optionalAttendees" : ["shane@contoso.com", "michael@contoso.com"],
        "start" : new Date("September 27, 2012 11:15:00"),
        "end" : new Date("September 27, 2012 12:30:00"),
        "location" : "Conf room 200",
        "resources" : ['sound', 'lighting', 'recording'],
        "subject" : "Next rehearsal",
        "body" : "This is about the next rehearsal."
    }

    // Display a form to create an appointment with
    // the specified parameters.
    myOm.displayNewAppointmentForm(formParameters);
}

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