Sdílet prostřednictvím


DocumentBase.ServerPolicy Property

Definition

Gets the policy that is specified for the document, when the document is stored on a server that is running Microsoft Office SharePoint Server.

public:
 property Microsoft::Office::Core::ServerPolicy ^ ServerPolicy { Microsoft::Office::Core::ServerPolicy ^ get(); };
public Microsoft.Office.Core.ServerPolicy ServerPolicy { get; }
member this.ServerPolicy : Microsoft.Office.Core.ServerPolicy
Public ReadOnly Property ServerPolicy As ServerPolicy

Property Value

A ServerPolicy object that represents the policy that is specified for the document, when the document is stored on a server that is running Microsoft Office SharePoint Server.

Examples

The following code example retrieves the information management policy that is associated with the current document and displays the policy name, description, and statement. To run this example, you must publish the document to a Microsoft Office SharePoint Server site and define an information management policy in the site. To use this example, run it from the ThisDocument class in a document-level project.

private void GetInformationManagementPolicy()
{            
    Office.ServerPolicy policy = this.ServerPolicy;
    MessageBox.Show("Information Management Policy: " + policy.Name 
        + "\r\nDescription: " + policy.Description 
        + "\r\nStatement: " + policy.Statement);
}
Private Sub GetInformationManagementPolicy()
    Dim policy As Office.ServerPolicy = Me.ServerPolicy
    MessageBox.Show("Information Management Policy: " + policy.Name _
        + vbCrLf + "Description: " + policy.Description _
        + vbCrLf + "Statement: " + policy.Statement)
End Sub

Applies to