Stamp reader-field agent

This simple agent stamps two reader fields on every selected document with a static role value.
LotusScript


Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As notesdatabase	
Set db = session.currentdatabase
Dim collect As notesdocumentcollection
Set collect = db.UnprocessedDocuments
If collect.count = 0 Then Exit Sub
Dim doc As notesdocument	
Set doc = collect.GetFirstDocument
	
Dim GCAdminItem As notesitem
Dim GCcmItem As notesitem
	
Do
	'Set the ADMIN Readers field
	Set GCAdminItem =  New NotesItem ( doc, "GCAdmin", "[Admin]" )
	GCAdminItem.IsReaders = True
	'Set the CONTENTMANAGER Readers field
	Set GCcmItem =  New NotesItem ( doc, "GCContentMgr", "[ContentManager]" )
	GCcmItem.IsReaders = True
	Call doc.save(True, True)
	counter = counter + 1
	Print counter & " of " & collect.count & " docs processed."
	Set doc = collect.GetNextDocument(doc)
Loop Until doc Is Nothing

Call workspace.viewrefresh

Posted by fbrefere001 on Wednesday July 2, 2008