Office.Sensitivity interface
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)
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, new Outlook on Windows, and Outlook on Mac 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)
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, new Outlook on Windows, and Outlook on Mac 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/90-other-item-apis/get-set-sensitivity-level.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)
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, new Outlook on Windows, and Outlook on Mac 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/90-other-item-apis/get-set-sensitivity-level.yaml
Office.context.mailbox.item.sensitivity.setAsync(
Office.MailboxEnums.AppointmentSensitivityType.Private,
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)
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, new Outlook on Windows, and Outlook on Mac only support Normal and Private sensitivity levels.
Errors:
Unsupported API parameter
: Setting the sensitivity level of an appointment isn't supported.
Office Add-ins