Domino Code Fragment

Code Name*
Agent to set Readers field security using IsReaders property.
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.15.221.67
Description*
This agent is used to reset a readers field once it has been changed to a type text.
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Sub Initialize
    Dim session As New NotesSession
    Dim doc As NotesDocument
    Dim db As NotesDatabase
    Set db = session.CurrentDatabase
    Dim collection As NotesDocumentCollection
    Set collection = db.UnprocessedDocuments
    Dim vSecurity As Variant
    For i = 1 To collection.Count
         Set doc = collection.GetNthDocument( i )
         If doc.hasitem("Readers") Then
              Set vSecurity = doc.getfirstitem("Readers")
              vSecurity.isreaders = True
              Call doc.save(True, True)
         End If
    Next i
End Sub