このエージェントは、ビューの既読文書の数を表示し、すべての文書に既読のマークを付け、次にビューの既読文書の新しい数を表示します。
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim vec As NotesViewEntryCollection
Set db = session.CurrentDatabase
Set view = db.GetView("All")
Set vec = view.GetAllReadEntries()
Messagebox vec.Count,, "Original read documents"
Call view.MarkAllRead()
Set vec = view.GetAllReadEntries()
Messagebox vec.Count,, "Read documents after MarkAllRead"
End Sub