Good stuff but I saw thru the code. I wonder why don't you use DXL and XSLT transformation?
It's easy to make any kind of HTML reports by XML export and transformation.
Like this one:
Sub Initialize
Dim ws As New NotesUIWorkspace<br/>
Dim s As New NotesSession<br/>
Dim db As NotesDatabase<br/>
Set db = ChooseDatabase<br/>
If db Is Nothing Then Exit Sub<br/>
Dim nc As notesNoteCollection<br/>
Set nc = getNotes(db)<br/>
<br/>
Dim choice As Variant<br/>
choice = ws.OpenFileDialog(False,"Файл, куда писать данные")<br/>
If Not Isarray(choice) Then Exit Sub<br/>
Dim filename As String<br/>
filename = choice(0)<br/>
<br/>
Dim streamMain As NotesStream<br/>
Set streamMain = s.CreateStream<br/>
If Not streamMain.Open(filename) Then<br/>
Msgbox "Невозможно открыть файл"<br/>
Exit Sub<br/>
End If<br/>
streamMain.Truncate<br/>
Dim DEX As NotesDXLExporter <br/>
Set DEX = s.CreateDXLExporter(nc)<br/>
DEX.ExitOnFirstFatalError = True<br/>
DEX.OutputDOCTYPE = False<br/>
DEX.SetOutput streammain<br/>
DEX.Process <br/>
End Sub