DocumentBase.ServerPolicy 属性

定义

获取为存储在运行 Microsoft Office SharePoint Server 的服务器上的文档指定的策略。

public Microsoft.Office.Core.ServerPolicy ServerPolicy { get; }

属性值

ServerPolicy

一个 ServerPolicy 对象,表示为存储在运行 Microsoft Office SharePoint Server 的服务器上的文档指定的策略。

示例

下面的代码示例检索与当前文档关联的信息管理策略,并显示策略名称、说明和语句。 若要运行此示例,您必须将文档发布到 Microsoft Office 的 SharePoint Server 站点并在站点中定义信息管理策略。 若要使用此示例,请在 ThisDocument 文档级项目的类中运行它。

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

适用于