Table of contents
TOC
折叠目录
展开目录

Permission.RemoveAll 方法 (办公室)Permission.RemoveAll Method (Office)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

从活动文档的权限集合中移除所有UserPermission对象。Removes all UserPermission objects from the Permission collection of the active document.

语法Syntax

表达式拔出所有expression. RemoveAll

表达式_一个表示权限对象的变量。_expression A variable that represents a Permission object.

注解Remarks

拔出所有方法中移除所有已添加到权限集的 UserPermissions 和禁用活动文档上的限制。调用拔出所有方法后,权限对象的Enabled属性返回FalseCount属性将返回 0 (零)。The RemoveAll method removes all UserPermissions that have been added to the Permission collection and disables restrictions on the active document. After calling the RemoveAll method, the Enabled property of the Permission object returns False and the Count property returns 0 (zero).

示例Example

若要删除用户的所有权限,并禁用活动文档上的限制,下面的示例使用的拔出所有方法。The following example uses the RemoveAll method to remove all user permissions and to disable restrictions on the active document.

 Dim irmPermission As Office.Permission 
 Set irmPermission = ActiveWorkbook.Permission 
 If irmPermission.Enabled Then 
 irmPermission.RemoveAll 
 MsgBox "All permissions removed." & vbCrLf & _ 
 "Count: " & irmPermission.Count & vbCrLf & _ 
 "Enabled: " & irmPermission.Enabled, _ 
 vbInformation + vbOKOnly, "IRM Information" 
 Else 
 MsgBox "This document is not restricted.", _ 
 vbInformation + vbOKOnly, "IRM Information" 
 End If 
 Set irmPermission = Nothing 

另请参阅See also

概念Concepts

权限对象Permission Object

其他资源Other resources

权限对象成员Permission Object Members

© 2018 Microsoft