Office.IsAllDayEvent interface

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.

Provides methods to get and set the all-day event status of a meeting in an Outlook add-in.

Remarks

[ API set: Mailbox preview ]

Minimum permission level: read item

Applicable Outlook mode: Compose

Methods

getAsync(options, callback)

Gets the boolean value indicating whether the event is all day or not.

getAsync(callback)

Gets the boolean value indicating whether the event is all day or not.

setAsync(isAllDayEvent, options, callback)

Sets the all-day event status of an appointment.

setAsync(isAllDayEvent, callback)

Sets the all-day event status of an appointment.

Method Details

getAsync(options, callback)

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.

Gets the boolean value indicating whether the event is all day or not.

getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult<boolean>) => void): void;

Parameters

options
Office.AsyncContextOptions

An object literal that contains one or more of the following properties:- asyncContext: Developers can provide any object they wish to access in the callback function.

callback

(asyncResult: Office.AsyncResult<boolean>) => void

When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult.

Returns

void

Remarks

[ API set: Mailbox preview ]

Minimum permission level: read item

Applicable Outlook mode: Compose

getAsync(callback)

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.

Gets the boolean value indicating whether the event is all day or not.

getAsync(callback: (asyncResult: Office.AsyncResult<boolean>) => void): void;

Parameters

callback

(asyncResult: Office.AsyncResult<boolean>) => void

When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult.

Returns

void

Remarks

[ API set: Mailbox preview ]

Minimum permission level: read item

Applicable Outlook mode: Compose

Examples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/99-preview-apis/get-set-isalldayevent.yaml

Office.context.mailbox.item.isAllDayEvent.getAsync(function(asyncResult) {
  if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
    console.log("Is this an all-day event? " + asyncResult.value);
  } else {
    console.log("Failed to get if this is an all-day event. Error: " + JSON.stringify(asyncResult.error));
  }
});

setAsync(isAllDayEvent, options, callback)

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.

Sets the all-day event status of an appointment.

setAsync(isAllDayEvent: boolean, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;

Parameters

isAllDayEvent

boolean

boolean value to set the all day event status.

options
Office.AsyncContextOptions

An object literal that contains one or more of the following properties:- asyncContext: Developers can provide any object they wish to access in the callback function.

callback

(asyncResult: Office.AsyncResult<void>) => void

Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an Office.AsyncResult object.

Returns

void

Remarks

[ API set: Mailbox preview ]

If an appointment is marked as an all-day event: - Start and end time will be marked as 12:00 AM (just like in the Outlook UI). Start time will return 12:00 AM and end time will be 12:00 AM the next day.

Minimum permission level: read/write item

Applicable Outlook mode: Compose

Examples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/99-preview-apis/get-set-isalldayevent.yaml

Office.context.mailbox.item.isAllDayEvent.setAsync(true, function(asyncResult) {
  if (asyncResult.status === Office.AsyncResultStatus.Failed) {
    console.log("Failed to set all-day event: " + JSON.stringify(asyncResult.error));
  } else {
    console.log("Appointment set to all-day event.");
  }
});

setAsync(isAllDayEvent, callback)

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.

Sets the all-day event status of an appointment.

setAsync(isAllDayEvent: boolean, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;

Parameters

isAllDayEvent

boolean

boolean value to set the all day event status.

callback

(asyncResult: Office.AsyncResult<void>) => void

Optional. When the method completes, the function passed in the callback parameter is called with a single parameter, asyncResult, which is an Office.AsyncResult object.

Returns

void

Remarks

[ API set: Mailbox preview ]

If an appointment is marked as an all-day event: - Start and end time will be marked as 12:00 AM (just like in the Outlook UI). Start time will return 12:00 AM and end time will be 12:00 AM the next day.

Minimum permission level: read/write item

Applicable Outlook mode: Compose