このエージェントは、既読文書の NotesViewEntryCollection を作成し、「All」ビューの最初の文書がそのコレクション内にあるかどうかを判別します。
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim vec As NotesViewEntryCollection
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set view = db.GetView("All")
view.AutoUpdate = False
Set vec = view.GetAllReadEntries()
Set doc = view.GetFirstDocument
If vec.Contains(doc) Then
Print "The first document has been read."
Else
Print "The first document was not read."
End If
End Sub