Hello,
I have an agent who create Document from XML file.
The process works fine.
But I want add an attachment in the body of my document. I don’t know how to do because I never do a doc.save
What is the best solution :
-
to add the attachment before to do import.process ?
-
or retrieve the UNID and update my document ?
Thanks to give me the best way and how to do it.
Nicolas
Please see below my agent :
Sub ImportXML(XmlFileName As String, serverName As String, dabaseName As String)
Dim session As New NotesSession
Dim db2 As NotesDatabase
Print "serverxml : " & "" & serverName & ""
Print "dabaseNamexml : " & "" & dabaseName & ""
Set db2 = New NotesDatabase(serverName, dabaseName)
Dim stream As NotesStream
Set stream = session.CreateStream
If Not stream.Open("./temp/" & XmlFileName) Then
Print "WARNING : Cannot open " & XmlFileName
Exit Sub
End If
If stream.Bytes = 0 Then
Print "WARNING : File " & XmlFileName & " did not exist or was empty"
Exit Sub
End If
Dim importer As NotesDXLImporter
Set importer = session.CreateDXLImporter(stream, db2)
Call importer.Process
End Sub