このエージェントは、ビューの未読文書の数を表示し、未読文書のすべてに既読のマークを付け、次にビューの未読文書の新しい数を表示します。
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")
view.AutoUpdate = False
Set vec = view.GetAllUnreadEntries()
Messagebox vec.Count,, "Original unread documents"
Call vec.MarkAllRead()
Set vec = view.GetAllUnreadEntries()
Messagebox vec.Count,, "Unread documents after MarkAllRead"
End Sub