Permission.PermissionFromPolicy property (Office)
Gets a Boolean value that indicates whether a permission policy has been applied to the active document. Read-only.
Syntax
expression.PermissionFromPolicy
expression A variable that represents a Permission object.
Remarks
Information Rights Management in Microsoft Office supports the use of administrative permission policies that list users and groups and their document permissions. The PermissionFromPolicy property returns a Boolean value that indicates whether a permission policy was applied to the active document the last time permissions were enabled on the document.
The PermissionFromPolicy property always returns False when checked by a non-owner of the document, even when the user has object model permissions.
Example
The following example displays permission policy information about the active document.
Dim irmPermission As Office.Permission
Dim strIRMInfo As String
Set irmPermission = ActiveWorkbook.Permission
If irmPermission.Enabled Then
strIRMInfo = "Permissions are restricted on this document." & vbCrLf
If irmPermission.PermissionFromPolicy Then
strIRMInfo = strIRMInfo & " Permissions applied from policy:" & vbCrLf & _
" Policy name: " & irmPermission.PolicyName & vbCrLf & _
" Policy description: " & irmPermission.PolicyDescription
Else
strIRMInfo = strIRMInfo & " Default permissions applied." & vbCrLf & _
" Default policy name: " & irmPermission.PolicyName & vbCrLf & _
" Default policy description: " & irmPermission.PolicyDescription
End If
Else
strIRMInfo = "Permission are NOT restricted on this document."
End If
MsgBox strIRMInfo, vbInformation + vbOKOnly, "IRM Information"
Set irmPermission = Nothing
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.