Subject: RE: Help with DXLImporter
Here’s the complete code for the function
Function CreateNewHotspot(s As NotesSession, ws As NotesUIWorkspace, this_db As NotesDatabase, strDBTitle As String) As NotesDocument
' Purpose: Build a document using DXL and import into the current database and return the new document
On Error Goto ErrorHandler
Set stream = s.CreateStream
’ Build the DXL document including the button in the Rich Text field
stream.WriteText{<?xml version="1.0" encoding="utf-8" ?>
The following MWG Policy Manuals exist:
MWG Quality Assurance Manual
Use “Navigation”
Sub Click(Source As Button) Call LaunchWorkspaceDocument(“MWGQuality”) End Sub
}
’ Import new document with button into current database
Set dmp = s.CreateDXLImporter(stream, this_db)
dmp.DocumentImportOption = DXLIMPORTOPTION_CREATE
dmp.Process
’ Get the NoteID of the newly created document
tmpNoteID = dmp.GetFirstImportedNoteID( )
’ Get the document by the NoteID and return it
Set newdoc = this_db.GetDocumentByID(tmpNoteID)
If Not (newdoc Is Nothing) Then
Set CreateNewHotspot = newdoc
Else
Messagebox "New document could not be found.", 0, "ERROR"
End If
Exit Function
ErrorHandler:
’ If there’s a problem processing the DXL, you will be prompted with the Row and Column
Msgbox dmp.Log
Print Lsi_info(2) + " - Error #" & Format$(Err) & " at line " & Format$(Erl) & ": " & Error$
Messagebox Lsi_info(2) + " - Error #" & Format$(Err) & " at line " & Format$(Erl) & ": " & Error$, 0, "Error"
Exit Function
End Function
Just call this function from the agent.
Anyone have any idea about my issue? Help needed!