Hello,
I’m currently trying to import DXL/XML files into an empty template.
Unfortunately it does not work. It cannot find the form I used to produce the files. I thought that the DXLImporter creats the fields itself.
How can I make it work?
This is the current algorithm:
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim ws As New NotesUIWorkspace
filenames = ws.OpenFileDialog(True,,,"c:\dxl",)
j = Ubound(filenames)
For i=0 To j
REM Open xml file named after current database
filename$ = filenames(i)
Dim stream As NotesStream
Set stream = session.CreateStream
If Not stream.Open(filename$) 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 Create new database named after current database
Dim dbCopy As NotesDatabase
Set dbCopy = New NotesDatabase("", "")
Call dbCopy.Create("", filename$ & "Copy", True)
REM Import DXL into new database
Dim importer As NotesDXLImporter
Set importer = session.CreateDXLImporter(stream, db)
importer.DesignImportOption = 6
Call importer.Process
Next i
End Sub