UserPermission.Remove method (Office)

Removes the specified UserPermission object from the Permission collection of the active document.

Syntax

expression.Remove

expression Required. A variable that represents a UserPermission object.

Remarks

The UserPermission object associates a set of permissions on the active document with a single user and an optional expiration date. The Remove method removes the user and the set of user permissions determined by the specified UserPermission object.

Example

The following example removes the second user's permissions on the active document from the document's Permission collection.

 Dim irmPermission As Office.Permission 
 Dim irmUserPerm As Office.UserPermission 
 Set irmPermission = ActiveWorkbook.Permission 
 Set irmUserPerm = irmPermission.Item(2) 
 irmUserPerm.Remove 
 MsgBox "Permission removed.", _ 
 vbInformation + vbOKOnly, "IRM Information" 
 Set irmUserPerm = Nothing 
 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.