次のエージェントは「Times」という日時アイテムの値を取得します。エージェントは値の各要素をチェックし、NotesDateTime と NotesDateRange のどちらのオブジェクトであるか確認します。
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim count As Integer
Set db = session.CurrentDatabase
Set dc = db.UnprocessedDocuments
If dc.Count = 0 Then Exit Sub
Set doc = dc.GetFirstDocument
times = doc.GetItemValueDateTimeArray("Times")
count = 0
Forall t In times
count = count + 1
If Typename(t) = "NOTESDATETIME" Then
Messagebox t.LocalTime,, "Date/time # " & count
Elseif Typename(t) = "NOTESDATERANGE" Then
Messagebox t.StartDateTime.LocalTime & " - " & _
t.EndDateTime.LocalTime,, "Date/time # " & count
End If
End Forall
End Sub