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