CreateDXLExporter not exporting richtext content

this is driving me mad…Trying to export the current document as xml to a file, the code extract below is called from onsubmit() but cannot get the exported file to include any of the content in the rich text field (whether it be text, attachment or a picture). Any have any ideas??

Function isRTempty( this_doc As notesdocument, chkField As String ) As String

On Error Goto this_error

Dim exporter As NotesDXLExporter

Dim stream As NotesStream

Set stream = this_session.CreateStream

Call stream.Open("c:" & this_doc.DocSubject(0) + “.dxl”)

Set exporter = this_session.CreateDXLExporter(this_doc, stream)

Call exporter.Process

Call stream.Close

Exit Function

this_error:

Msgbox "Error" & Str(Err) & ": " & Error$

End Function

Subject: RE: CreateDXLExporter not exporting richtext content

To access the back-end rich text in a document you are editing, you have to first use uidoc.Refresh(True). This has other effects besides reloading the rich text, however (it refreshes the document and executes validation formulas).

You might want to check uidoc.fieldgettext first, because this doesn’t need to refresh the document and you know if there’s text in there the field is not empty. If you don’t see text, then you could refresh the document and look for other things.

There are also tricks you can do that involve moving the cursor to the field and trying to select all to see whether you get an error, but this may not work in later versions, and may also have side effects.