ServerPolicy Object (Office)

Office 2013 and later

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Represents a policy specified for a document type stored on a server running Microsoft Office SharePoint Server.

The ServerPolicy object is composed of individual PolicyItem objects representing the individual policy definitions for the active document.

The following example lists the name and description of all of the policy items for the active document.

Sub ListPolicyItems() 
Dim objSrvPolicy As ServerPolicy 
Dim objPolicyItem As PolicyItem 
Dim strPolicyItemList As String 
Set objSrvPolicy = ActiveDocument.ServerPolicy 
For Each objPolicyItem In objSrvPolicy 
 strPolicyItemList = "Policy Item " & objPolicyItem.Name & " - " & _ 
 objPolicyItem.Description & vbCrLf 
MsgBox (strPolicyItemList) 
End Sub