Function BuildRoleMembers(db As NotesDatabase, rolename As String) As Variant ' this functions analyzes this database's acl (db) for a role. ' returns result list of persons/groups with the role ' db - this db object ' rolename - the rolename already in brackets that is "key" to getting names Dim acl As NotesACL ' db's acl Dim entry As NotesACLEntry ' a specific acl entry Dim rolemembers() As String ' a string list of role's results of persons/groups Dim membercount As Integer ' counting variable for building above list Dim foundRole As Variant ' true false test for acl found foundRole = False ' setup working variables membercount=0 foundRole=False ' set to false for function start ' setup object environment Set acl = db.ACL ' check to see if the role exists in the database Forall r In acl.Roles If ( r = roleName ) Then foundRole = True Exit Forall End If End Forall ' foundRole true or false? If Not foundRole Then ' false - role was not found we need to return a list of nothing Redim rolemembers(0) rolemembers(0)="" BuildRoleMembers = rolemembers Else ' we need to loop through entries building list of persons/groups with role Set entry = acl.GetFirstEntry While Not ( entry Is Nothing ) If entry.IsRoleEnabled( roleName ) Then ' we have an acl entry with our role, we need to test type If (entry.IsPerson Or entry.IsGroup) Then ' we have a person or group (versus a server), add to list Redim Preserve rolemembers(membercount) rolemembers(membercount) = entry.Name membercount=membercount + 1 End If End If Set entry = acl.GetNextEntry( entry ) Wend ' we have completed list, and need to return list BuildRoleMembers = rolemembers End If End Function