Item object (JavaScript API for Office v1.0)

JavaScript API for Office v1.0

Provides a base object for all items provided by an application.

Last modified: August 27, 2014

Office.context.mailbox.item

Methods

Method name

Description

loadCustomPropertiesAsync

Loads custom properties that have been stored on the server for a specified item.

Properties

Property name

Description

dateTimeCreated

Gets the date and time that the item was created.

dateTimeModified

Gets the date and time that the item was last modified.

itemClass

Gets the item class of the item.

itemId

Gets the unique identifier for the item.

itemType

Gets the type of the item.

The Item object is the base object for objects that represent the specified item. You can determine the actual Item instance returned by using the itemType property. The descendent of the Item object associated with the item type is listed in the following table.

Item type

Object

Meeting

Appointment

Message

Message

The following JavaScript code example shows how to access the subject property of the current item in Outlook. Note that the current item can be a Message object or Appointment object, both of which extend the Item object.

// The initialize function is required for all apps.
Office.initialize = function () {
    // Checks for the DOM to load using the jQuery ready function.
    $(document).ready(function () {
    // After the DOM is loaded, app-specific code can run.
    var item = Office.context.mailbox.item;
    var subject = item.subject;
    // Continue with processing the subject of the current item, which can be a message or appointment.
    });
}

Supported clients

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

Library

Outlook-15.js, OutlookWebApp-15.js

Namespace

Office

Show:
© 2014 Microsoft