例: SinceTime property

次のエージェントは、現在のデータベース内の文書のうち、1 日前から現時点までに作成された文書を含む文書コレクションを作成します。

Sub Initialize
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Set db = session.CurrentDatabase
  
  REM Open xml file named after current database
  Dim stream As NotesStream
  Set stream = session.CreateStream
  path$ = "c:¥dxl¥"
  filename$ = Left(db.FileName, Len(db.FileName) - 3) & "dxl"
  filename$ = path$ & filename$
  If Not stream.Open(filename$) Then
    Messagebox "Cannot open " & filename$,, "Error"
    Exit Sub
  End If
  Call stream.Truncate

  REM Create date for yesterday
  Dim dt As New NotesDateTime("Yesterday")
  
  REM Create note collection
  Dim nc As NotesNoteCollection
  Set nc = db.CreateNoteCollection(False)
  nc.SelectDocuments = True
  Set nc.sinceTime = dt
  Call nc.BuildCollection
  
  REM Export note collection as DXL
  Dim exporter As NotesDXLExporter
  Set exporter = session.CreateDXLExporter(nc, stream)
  Call exporter.Process
End Sub