PolicyLabel class

Provides the policy ID for the PolicyLabel objects.


Namespace:  Microsoft.Office.RecordsManagement.PolicyFeatures
Assembly:  Microsoft.Office.Policy (in Microsoft.Office.Policy.dll)

[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public class PolicyLabel : IPolicyFeature

The following code example shows how to get a policy item's CustomData property. This example contains a chunk of XML that has information you can use to implement SharePoint information management features.

using Microsoft.Office.RecordsManagement.InformationPolicy; 

using (SPSite site = new SPSite(documentUrl)) 


     using (SPWeb web = site.OpenWeb()) 


       SPFile docFile = web.GetFile(documentUrl); 

       Policy docPolicy = Policy.GetPolicy(docFile.Item.ContentType); 

       PolicyItem docPolicyItem = docPolicy.Items["Microsoft.Office.RecordsManagement.PolicyFeatures.PolicyLabel"]; 

       return docPolicyItem.CustomData; 



Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.