Sub SetLabelInfoINTERNAL()
Dim myLabelInfo As LabelInfo
Set wb = ThisWorkbook
Set myLabelInfo = wb.SensitivityLabel.CreateLabelInfo()
With myLabelInfo
'put your information here ***********************
.ActionId = "c0f18baa-5255-463b-8176-67e75ee5abc4"
.AssignmentMethod = MsoAssignmentMethod.PRIVILEGED
.ContentBits = 2
.IsEnabled = True
.Justification = "Some justification needed only if downgrading label."
.LabelId = "eae83a4f-cc5f-4276-a1aa-251cec914c6b"
.LabelName = "Internal"
.SetDate = Now()
.SiteId = "d554a4b7-b1f6-4714-a568-fd4d48c146a6"
End With
Call wb.SensitivityLabel.setLabel(myLabelInfo, myLabelInfo)
End Sub
Sub SetLabelInfoEXTERNAL()
Dim myLabelInfo As LabelInfo
Set wb = ThisWorkbook
Set myLabelInfo = wb.SensitivityLabel.CreateLabelInfo()
With myLabelInfo
'Put Your information here ***********************
.ActionId = "e00c1536-0827-5aca-8e56-ef075b47683a"
.AssignmentMethod = MsoAssignmentMethod.PRIVILEGED
.ContentBits = 2
.IsEnabled = True
.Justification = "Some justification needed only if downgrading label."
.LabelId = "97be529e-63ab-4d1a-985e-0328b4465a07"
.LabelName = "External"
.SetDate = Now()
.SiteId = "d584a8b7-b1f2-7714-a278-fd4d83c145a6"
End With
Call wb.SensitivityLabel.setLabel(myLabelInfo, myLabelInfo)
End Sub
Sub getLabelInfo()
Dim senLabelInfo As Office.LabelInfo
Set wb = ThisWorkbook
Set senLabelInfo = wb.SensitivityLabel.GetLabel()
Call wb.Sheets("Sheet1").Activate
property1 = senLabelInfo.LabelName
property2 = senLabelInfo.LabelId
property3 = senLabelInfo.SiteId
property4 = senLabelInfo.SetDate
property5 = senLabelInfo.ActionId
property6 = senLabelInfo.Application
property7 = senLabelInfo.AssignmentMethod
property8 = senLabelInfo.ContentBits
property9 = senLabelInfo.Creator
property10 = senLabelInfo.IsEnabled
property11 = senLabelInfo.Justification
Range("A1").Value = "Label Name"
Range("B1").Value = property1
Range("A2").Value = "Lablel ID"
Range("B2").Value = property2
Range("A3").Value = "Site ID"
Range("B3").Value = property3
Range("A4").Value = "Set Date"
Range("B4").Value = property4
Range("A5").Value = "ActionId"
Range("B5").Value = property5
Range("A6").Value = "Application"
Range("B6").Value = property6
Range("A7").Value = "AssignmentMethod"
Range("B7").Value = property7
Range("A8").Value = "ContentBits"
Range("B8").Value = property8
Range("A9").Value = "Creator"
Range("B9").Value = property9
Range("A10").Value = "IsEnabled"
Range("B10").Value = property10
Range("A11").Value = "Justification"
Range("B11").Value = property11
End Sub