Option Declare ' always use Option Declare

Sub Initialize
	On Error Goto oops	' standard error trapping
	Dim session As New NotesSession
	Dim dxli As NotesDXLImporter
	Dim db As NotesDatabase
	Dim stream As NotesStream
	Dim inputfile
	Dim wksp As New NotesUIWorkspace
	
	inputfile = wksp.OpenFileDialog( False , "DXL Import" , , , )
	If Isempty(inputfile) Then Exit Sub
	
	Set stream = session.CreateStream
	stream.Open(inputfile(0))
	Set db = session.CurrentDatabase
	Set dxli = session.CreateDXLImporter(stream, db)
	dxli.DesignImportOption = DXLIMPORTOPTION_REPLACE_ELSE_CREATE
	dxli.ACLImportOption = DXLIMPORTOPTION_IGNORE
	dxli.DocumentImportOption = DXLIMPORTOPTION_IGNORE
	dxli.ReplicaRequiredForReplaceOrUpdate = False
	dxli.ReplaceDBProperties = False
	dxli.Process
	' if the import succeeded, sign the new design notes.
	If dxli.ImportedNoteCount Then
		Dim strID$
		strID = dxli.GetFirstImportedNoteId()
		Do Until strID = ""
			Dim docDesign As NotesDocument
			Set docDesign = db.GetDocumentByID(strID)
			Call docDesign.Sign()
			Call docDesign.Save(True, False, True)
			strID = dxli.GetNextImportedNoteId(strID)
		Loop
	End If
	Exit Sub
oops:
	Msgbox "Error " & Err & " line " & Erl & ": " & Error
	Exit Sub
End Sub