Office.Sensitivity interface
注意
此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。
提供获取和设置约会敏感度级别的方法。 若要了解有关敏感度级别的详细信息,请参阅 将电子邮件标记为普通、个人、专用或机密。
注解
[ API 集:邮箱预览 ]
最低权限级别: 读取项
方法
get |
获取约会的敏感度级别。 |
get |
获取约会的敏感度级别。 |
set |
设置约会的敏感度级别。 |
set |
设置约会的敏感度级别。 |
方法详细信息
getAsync(options, callback)
注意
此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。
获取约会的敏感度级别。
getAsync(options: Office.AsyncContextOptions, callback: (asyncResult: Office.AsyncResult<MailboxEnums.AppointmentSensitivityType>) => void): void;
参数
- options
- Office.AsyncContextOptions
包含以下一个或多个属性的对象文本:- asyncContext
:开发人员可以在回调函数中提供他们想要访问的任何对象。
- callback
-
(asyncResult: Office.AsyncResult<Office.MailboxEnums.AppointmentSensitivityType>) => void
方法完成后,使用单个参数 asyncResult
(即 Office.AsyncResult
对象)调用在 参数中callback
传递的函数。 在 属性中 asyncResult.value
返回约会的敏感度级别。
返回
void
注解
[ API 集:邮箱预览 ]
最低权限级别: 读取项
重要提示:Outlook 网页版、Outlook on Mac 和新 Outlook on Windows (预览版) 仅支持正常和专用敏感度级别。 如果从这些客户端调用 getAsync
具有机密或个人敏感级别的约会,则会在 属性中 asyncResult.value
返回正常敏感度级别。
getAsync(callback)
注意
此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。
获取约会的敏感度级别。
getAsync(callback: (asyncResult: Office.AsyncResult<MailboxEnums.AppointmentSensitivityType>) => void): void;
参数
- callback
-
(asyncResult: Office.AsyncResult<Office.MailboxEnums.AppointmentSensitivityType>) => void
方法完成后,使用单个参数 asyncResult
(即 Office.AsyncResult
对象)调用在 参数中callback
传递的函数。 在 属性中 asyncResult.value
返回约会的敏感度级别。
返回
void
注解
[ API 集:邮箱预览 ]
最低权限级别: 读取项
重要提示:Outlook 网页版、Outlook on Mac 和新 Outlook on Windows (预览版) 仅支持正常和专用敏感度级别。 如果从这些客户端调用 getAsync
具有机密或个人敏感级别的约会,则会在 属性中 asyncResult.value
返回正常敏感度级别。
示例
// 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)
注意
此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。
设置约会的敏感度级别。
setAsync(sensitivity: MailboxEnums.AppointmentSensitivityType | string, options: Office.AsyncContextOptions, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;
参数
- sensitivity
枚举或字符串的敏感度级别。
- options
- Office.AsyncContextOptions
包含以下一个或多个属性的对象文本:- asyncContext
:开发人员可以在回调函数中提供他们想要访问的任何对象。
- callback
-
(asyncResult: Office.AsyncResult<void>) => void
可选。 方法完成后,使用单个参数 asyncResult
(即 Office.AsyncResult
对象)调用在 参数中callback
传递的函数。
返回
void
注解
[ API 集:邮箱预览 ]
最低权限级别: 读/写项
重要提示:Outlook 网页版、Outlook on Mac 和新 Outlook on Windows (预览版) 仅支持正常和专用敏感度级别。
错误:
Unsupported API parameter
:不支持设置约会的敏感度级别。
示例
// 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)
注意
此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。
设置约会的敏感度级别。
setAsync(sensitivity: MailboxEnums.AppointmentSensitivityType | string, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;
参数
- sensitivity
枚举或字符串的敏感度级别。
- callback
-
(asyncResult: Office.AsyncResult<void>) => void
可选。 方法完成后,使用单个参数 asyncResult
(即 Office.AsyncResult
对象)调用在 参数中callback
传递的函数。
返回
void
注解
[ API 集:邮箱预览 ]
最低权限级别: 读/写项
重要提示:Outlook 网页版、Outlook on Mac 和新 Outlook on Windows (预览版) 仅支持正常和专用敏感度级别。
错误:
Unsupported API parameter
:不支持设置约会的敏感度级别。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈