Table of contents
TOC
Collapse the table of content
Expand the table of content

UserPermission.UserId Property (Office)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Gets the e-mail name of the user whose permissions on the active document are determined by the specified UserPermission object. Read-only.

Syntax

expression. UserId

expression 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 UserID property returns the name in e-mail form of the user whose permissions are determined by the specified UserPermission object.

Example

The following example lists the users who have permissions on the active document.

 Dim irmPermission As Office.Permission 
 Dim irmUserPerm As Office.UserPermission 
 Dim strUsers As String 
 Set irmPermission = ActiveWorkbook.Permission 
 If irmPermission.Enabled Then 
 For Each irmUserPerm In irmPermission 
 strUsers = strUsers & irmUserPerm.UserId & vbCrLf 
 Next 
 MsgBox strUsers, _ 
 vbInformation + vbOKOnly, "IRM Information" 
 Else 
 MsgBox "Permissions are not enabled for this document.", _ 
 vbInformation + vbOKOnly, "IRM Information" 
 End If 
 Set irmUserPerm = Nothing 
 Set irmPermission = Nothing 

See also

Concepts

UserPermission Object

Other resources

UserPermission Object Members

© 2018 Microsoft