SensitivityLabels
Presentation.SensitivityLabels property
Returns the collection of sensitivity labels applied to the presentation document. Read-only ISensitivityLabelCollection.
public ISensitivityLabelCollection SensitivityLabels { get; }
Examples
[C#]
using (Presentation pres = new Presentation("SomePresentation.pptx"))
{
ISensitivityLabelCollection sensitivityLabels = pres.SensitivityLabels;
// Print the applied labels
foreach (var sensitivityLabel in sensitivityLabels)
Console.WriteLine("Label Id " + sensitivityLabel.Id + " from Azure AD site " + sensitivityLabel.SiteId);
// Add the new label
string labelIdString = "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"; // Get the sensitivity label Id from the policy
Guid siteIdGuid = Guid.Parse("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"); // Get the Azure AD site identifier from the policy
var label = sensitivityLabels.Add(labelIdString, siteIdGuid, true, SensitivityLabelAssignmentType.Privileged);
label.ContentMarkTypes.Add(SensitivityLabelContentType.Footer);
pres.Save("SensitivityLabel.pptx", SaveFormat.Pptx);
}
See Also
- interface ISensitivityLabelCollection
- class Presentation
- namespace Aspose.Slides
- assembly Aspose.Slides