다음을 통해 공유


WorkbookBase.ServerPolicy Property

Gets an object that represents a policy specified for a workbook that is stored on a server running Microsoft Office SharePoint Server.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

Syntax

'Declaration
Public ReadOnly Property ServerPolicy As ServerPolicy
public ServerPolicy ServerPolicy { get; }

Property Value

Type: Microsoft.Office.Core.ServerPolicy
A Microsoft.Office.Core.ServerPolicy object that represents a policy specified for a workbook that is stored on a server running SharePoint Server.

Remarks

The following code example retrieves the information management policy associated with the current workbook and displays the policy name, description, and statement. To run this example, you must publish the workbook to a Microsoft Office Sharepoint Server site and define an information management policy in the site.

This example is for a document-level customization.

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
private void GetInformationManagementPolicy()
{
    Office.ServerPolicy policy = this.ServerPolicy;
    MessageBox.Show("Information Management Policy: " + policy.Name
        + "\r\nDescription: " + policy.Description
        + "\r\nStatement: " + policy.Statement);
}

.NET Framework Security

See Also

Reference

WorkbookBase Class

Microsoft.Office.Tools.Excel Namespace