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