Importation de mail au format DXL
- Code : Tout sélectionner
Sub Initialize
On Error Goto processError
Dim session As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim filename As String
Set db = session.CurrentDatabase
Dim stream As NotesStream
Set stream = session.CreateStream
If Not stream.Open("c:\temp\test.xml") 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
' Création du document à partir du fichier DXL modèle
Dim importer As NotesDXLImporter
Set importer = session.CreateDXLImporter
Call importer.SetInput(stream)
Call importer.SetOutput(db)
importer.ReplaceDBProperties = True
importer.ReplicaRequiredForReplaceOrUpdate = False
importer.ACLImportOption = DXLIMPORTOPTION_REPLACE_ELSE_IGNORE
importer.DesignImportOption = DXLIMPORTOPTION_CREATE
Call importer.Process
Exit Sub
processError:
Msgbox "Erreur " & Err() & ": " & Error() & " à la ligne: " & Cstr(Erl)
Exit Sub
End Sub
A utiliser avec Export DXL