The Permission of current workbook : Office Permmison « Application « VBA / Excel / Access / Word






The Permission of current workbook

 

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

 








Related examples in the same category

1.Enable permission
2.Add users
3.Show User Permissions
4.Remove Permissions
5.Show Permissions
6.Set office Permission