Permission.SensitivityLabelId property (Office)
Gets or sets the sensitivity label id included in user defined protection from Microsoft Purview Information Protection. Read/write.
Syntax
expression. SensitivityLabelId
expression A variable that represents a Permission.
Remarks
The SensitivityLabelId setting gets or sets the sensitivity label id included in user defined protection from Microsoft Purview Information Protection. Use the SensitivityLabelId property to specify the sensitivity label applied to any user defined permissions. Note that accessing the SensitivityLabelId property fails with CRYPT_E_ATTRIBUTES_MISSING if the license does not contain a sensitivity label id. If the license was created from specific permission policy xml (refer to PermissionFromPolicy), setting the SensitivityLabelId fails with CERTSRV_E_TEMPLATE_DENIED.
Example
The following example sets and displays the SensitivityLabelId setting.
Dim irmPermission As Office.Permission
Set irmPermission = ActiveWorkbook.Permission
If irmPermission.Enabled Then
MsgBox irmPermission.SensitivityLabelId, vbInformation + vbOKOnly, " SensitivityLabelId"
irmPermission. SensitivityLabelId = "24fb0e8b-8044-4bd6-9e86-77f9d21856dc"
MsgBox irmPermission.SensitivityLabelId, vbInformation + vbOKOnly, " SensitivityLabelId"
End If
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.