Office.SensitivityLabelDetails interface
表示 Outlook 中可用敏感度标签的属性。
注解
最低权限级别: 读取/写入项目
适用的 Outlook 模式:Compose
重要提示: 若要在加载项中使用敏感度标签功能,必须具有 Microsoft 365 E5 订阅。
若要详细了解如何在加载项中管理敏感度标签,请参阅 在撰写模式下管理邮件或约会的敏感度标签。
使用方
示例
// Check whether the catalog of sensitivity labels is enabled on the current mailbox.
Office.context.sensitivityLabelsCatalog.getIsEnabledAsync((asyncResult) => {
// If the catalog is enabled, get all available sensitivity labels.
if (asyncResult.status === Office.AsyncResultStatus.Succeeded && asyncResult.value == true) {
Office.context.sensitivityLabelsCatalog.getAsync((asyncResult) => {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
const catalog = asyncResult.value;
console.log("Sensitivity Labels Catalog:");
// Log the details of the available sensitivity labels to the console.
catalog.forEach((sensitivityLabel) => {
console.log(`Name: ${sensitivityLabel.name}`);
console.log(`ID: ${sensitivityLabel.id}`);
console.log(`Tooltip: ${sensitivityLabel.tooltip}`);
console.log(`Color: ${sensitivityLabel.color}`);
console.log(`Sublabels: ${JSON.stringify(sensitivityLabel.children)}`);
});
} else {
console.log("Action failed with error: " + asyncResult.error.message);
}
});
} else {
console.log("Action failed with error: " + asyncResult.error.message);
}
});
属性
| children | 敏感度标签的 子标签 。 如果标签没有任何子标签,则返回 |
| color | 敏感度标签的颜色。 |
| id | 敏感度标签的唯一标识符 (GUID) 。 |
| name | 敏感度标签的名称。 |
| tooltip | 敏感度标签的说明。 |
属性详细信息
children
color
敏感度标签的颜色。
color: string;
属性值
string
id
敏感度标签的唯一标识符 (GUID) 。
id: string;
属性值
string
name
敏感度标签的名称。
name: string;
属性值
string
tooltip
敏感度标签的说明。
tooltip: string;
属性值
string