Office.Sensitivity 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 sensitivity level of an appointment. To learn more about sensitivity levels, see Mark your email as Normal, Personal, Private, or Confidential.
Remarks
Minimum permission level: read item
Applicable Outlook mode: Compose
Methods
get |
Gets the sensitivity level of an appointment. |
get |
Gets the sensitivity level of an appointment. |
set |
Sets the sensitivity level of an appointment. |
set |
Sets the sensitivity level 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 sensitivity level of an appointment.
getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult<MailboxEnums.AppointmentSensitivityType>) => 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<Office.MailboxEnums.AppointmentSensitivityType>) => void
When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult
, which is an Office.AsyncResult
object. The sensitivity level of the appointment is returned in the asyncResult.value
property.
Returns
void
Remarks
Minimum permission level: read item
Applicable Outlook mode: Compose
Important: Outlook on the web, Outlook on Mac, and the new Outlook on Windows (preview) only support Normal and Private sensitivity levels. If you call getAsync
on an appointment that has a Confidential or Personal sensitivity level from these clients, the Normal sensitivity level is returned in the asyncResult.value
property.
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 sensitivity level of an appointment.
getAsync(callback: (asyncResult: Office.AsyncResult<MailboxEnums.AppointmentSensitivityType>) => void): void;
Parameters
- callback
-
(asyncResult: Office.AsyncResult<Office.MailboxEnums.AppointmentSensitivityType>) => void
When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult
, which is an Office.AsyncResult
object. The sensitivity level of the appointment is returned in the asyncResult.value
property.
Returns
void
Remarks
Minimum permission level: read item
Applicable Outlook mode: Compose
Important: Outlook on the web, Outlook on Mac, and the new Outlook on Windows (preview) only support Normal and Private sensitivity levels. If you call getAsync
on an appointment that has a Confidential or Personal sensitivity level from these clients, the Normal sensitivity level is returned in the asyncResult.value
property.
Examples
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/99-preview-apis/calendar-properties-apis.yaml
Office.context.mailbox.item.sensitivity.getAsync(function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log("Sensitivity: " + asyncResult.value);
} else {
console.log("Failed to get sensitivity: " + JSON.stringify(asyncResult.error));
}
});
setAsync(sensitivity, 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 sensitivity level of an appointment.
setAsync(sensitivity: MailboxEnums.AppointmentSensitivityType | string, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;
Parameters
- sensitivity
The sensitivity level as an enum or string.
- 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
Minimum permission level: read/write item
Applicable Outlook mode: Compose
Important: Outlook on the web, Outlook on Mac, and the new Outlook on Windows (preview) only support Normal and Private sensitivity levels.
Errors:
Unsupported API parameter
: Setting the sensitivity level of an appointment isn't supported.
Examples
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/99-preview-apis/calendar-properties-apis.yaml
Office.context.mailbox.item.sensitivity.setAsync(
Office.MailboxEnums.AppointmentSensitivityType.Confidential,
function callback(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Failed) {
console.log("Failed to set appointment sensitivity: " + JSON.stringify(asyncResult.error));
} else {
console.log("Successfully set appointment sensitivity.");
}
}
);
setAsync(sensitivity, 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 sensitivity level of an appointment.
setAsync(sensitivity: MailboxEnums.AppointmentSensitivityType | string, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;
Parameters
- sensitivity
The sensitivity level as an enum or string.
- 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
Minimum permission level: read/write item
Applicable Outlook mode: Compose
Important: Outlook on the web, Outlook on Mac, and the new Outlook on Windows (preview) only support Normal and Private sensitivity levels.
Errors:
Unsupported API parameter
: Setting the sensitivity level of an appointment isn't supported.
Office Add-ins
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for