Item.loadCustomPropertiesAsync method (JavaScript API for Office v1.0)

apps for Office

Asynchronously loads custom properties that are specific to the item and a app for Office.

Last modified: February 26, 2015



The method to call when the asynchronous load is complete. Required.


Any state data that is passed to the asynchronous method. Optional.

You must call the loadCustomPropertiesAsync method before using the CustomProperties object methods. Custom properties are saved on the Exchange Server 2013 as a property bag for an item. When the asynchronous call finishes, the method specified in the callback parameter is called by using one parameter, asyncResult, which contains the property bag in its value property. You can use the optional userContext parameter to pass any state information to the callback function. The callback function can then process the custom properties, such as setting a value and saving the property back to the Exchange server.

The following code example shows how to use the loadCustomPropertiesAsync method to asynchronously load custom properties that are specific to the current item in Microsoft Outlook. The example also shows how to use the CustomProperties.saveAsync method to save these properties back to the Exchange Server. After loading the custom properties, the code sample uses the CustomProperties.get method to read the custom property myProp, the CustomProperties.set method to write the custom property otherProp, and then finally calls the saveAsync method to save the custom properties.

// 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;

function customPropsCallback(asyncResult) {
    var customProps = asyncResult.value;
    var myProp = customProps.get("myProp");

    customProps.set("otherProp", "value");

function saveCallback(asyncResult) {

Supported clients

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


Outlook-15.js, OutlookWebApp-15.js



© 2015 Microsoft