Sets the fields of the selected documents and refresh the view

For use in a view action. -- Loops through all the selected documents in the view and sets the fields accordingly saves and refreshes the view.
Lotus Notes View • LotusScript

Sub Click(Source As Button)
     Dim session As New NotesSession
     Dim workspace As New NotesUIWorkspace
     Dim db As NotesDatabase
     Set db = session.CurrentDatabase
     Dim collect As NotesDocumentCollection
     Set collect = db.UnprocessedDocuments
     If collect.count = 0 Then
          Msgbox " No Document(s) selected!", 0 + 16
          Exit Sub
     End If
     Dim Doc1 As NotesDocument
     Set Doc1 = collect.GetFirstDocument
          Doc1.FilingCabinet = "YES"
          Doc1.Immigration = "Immigration"
          Call Doc1.Save(True, True)
          Set Doc1 = collect.GetNextDocument(Doc1)
     Loop Until Doc1 Is Nothing
     Call workspace.viewrefresh     
End Sub

Posted by fbrefere001 on Friday October 12, 2001