Sub ShowPermissions()
Dim myPermission As Office.Permission, str As String
Set myPermission = ThisWorkbook.Permission
If myPermission.Enabled Then
If myPermission.PermissionFromPolicy Then
Debug.Print "Policy name: " & myPermission.PolicyName
Debug.Print "Policy description: " & myPermission.PolicyDescription
Else
Debug.Print "Default policy name: " & myPermission.PolicyName
Debug.Print "Default policy description: " & myPermission.PolicyDescription
End If
Else
Debug.Print "Permission are NOT restricted on this document."
End If
End Sub
|