例: DocumentImportOption property

次のエージェントは、ファイルの DXL を既存のデータベースに呼び出します。エージェントはデータベースの文書を、呼び出された DXL の文書で置き換えます。

Sub Initialize
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Set db = session.CurrentDatabase
  filename$ = Left(db.FileName, Len(db.FileName) - 4)
  
  REM Open xml file named after current database
  Dim stream As NotesStream
  Set stream = session.CreateStream
  If Not stream.Open("c:¥dxl¥" & filename$ & ".dxl") Then
    Messagebox "Cannot open " & filename$,, "Error"
    Exit Sub
  End If
  If stream.Bytes = 0 Then
    Messagebox "File did not exist or was empty",, filename$
    Exit Sub
  End If
  
  REM Replace documents in this database with matching ones in the DXL
  Dim importer As NotesDXLImporter
  Set importer = session.CreateDXLImporter(stream, dbCopy)
  importer.DocumentImportOption = DXLIMPORTOPTION_REPLACE_ELSE_IGNORE
  Call importer.Process
End Sub