Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim dt As New NotesDateTime("01/01/80")
Dim doc As NotesDocument
Dim item As NotesItem
Set db = s.CurrentDatabase
Set dc = db.Search("Form = 'Person'",dt, 0)
For i = 1 To dc.Count
Set doc = dc.GetNthDocument(i)
Print "Working on... " + doc.FullName(0)
Call doc.ComputeWithForm(False, False)
Dim nabFullNameView As NotesView
Dim nabServerAccessView As NotesView
Dim nabPerson1 As NotesView
Set nabFullNameView = db.GetView("($LDAPCN)")
Set nabServerAccessView = db.GetView("($ServerAccess)")
Set nabPerson1 = db.GetView("($VIMPeople)")
Call nabFullNameView.Refresh
Call nabServerAccessView.Refresh
Call nabPerson1.Refresh
Call s.Close
Call doc.ReplaceItemValue("Status","Processed")
Call doc.Save(True, True)
Next
Messagebox "Agent is finished running.", 0, "Lotus Notes"
End Sub