Subject: RE: NotesDXLExporter class and notesrichtextitem
Below is rough code… I just dumped this into an existing button for testing… some extra dims in there.
I am getting my richtext item using doc.getfirstitem(“”). In the below code, I am putting it into a richtextitem, but I have also tried putting it into a variant. Both throw the error I mentioned in last post.
Any ideas?
On Error Goto errorHandler
’ Date: 06/07/2005
’ Created by: Jamie Haynes
’ Purpose To generate a ‘Printable’ Manager Report with all Daily Data document information
'included.
’ Paramenters: n/a
’ Called From: Generate Print Out action button
’ Calls:LogError from OpenLogFunctions SL
'IntegerToWeekDay function in Utilities SL
’ Globals: LocationToName function in Utilities SL
Dim nsess As New notessession ’ Used in error handling as well.
Dim rtitemRptDetails As notesrichtextitem
dim ndocCurrent As notesdocument
Dim wrkSpc As New notesuiworkspace
Dim uidocCurrent As notesuidocument
Dim ndbCurrent As notesdatabase
Dim rtnav As NotesRichTextNavigator
Dim ndocDailyData As notesdocument
Dim strLookup As String
Dim varRetVal As Variant
Set ndbCurrent = nsess.currentdatabase
'// Get handle to current document
Set uidocCurrent = wrkSpc.currentdocument
Set ndocCurrent = uidocCurrent.document
’ TEST -------------------------------------------------------------------//
'This agent generates DXL from the current database.
’ Dim session As New NotesSession
’ Dim db As NotesDatabase
’ Set db = session.CurrentDatabase
Dim filename As String
REM Open xml file named after current database
Dim stream As NotesStream
Set stream = nsess.CreateStream
filename$ = "c:\dxl" & Left( ndbCurrent.FileName, Len( ndbCurrent.FileName) - 3) & “dxl”
If Not stream.Open(filename$) Then
Messagebox "Cannot open " & filename$,, "Error"
Exit Sub
End If
Call stream.Truncate
REM Export current database as DXL
Dim exporter As NotesDXLExporter
Set exporter = nsess.CreateDXLExporter
'Dim varDet as variant
Dim rtitmDet As notesrichtextitem
Set rtitmDet = ndocCurrent.GetFirstItem(“Details”)
Call exporter.SetInput( rtitmDet ) ’ varDet ndocCurrent ; ’ ndbCurrent
Call exporter.SetOutput( stream )
Call exporter.Process
Msgbox "All done!"
Exit Sub