Text is truncated when accessed using Rich Text Navigator

I wrote a Lotus Script Agent to export a Rich Text field named Body from a Design Synopsis database to a text file using the sample code fron the Designer Help. It uses the NotesRichTextNavigator and NotesRichTextRange classes. When I ran the program and compared the output to a text file created by the Export menu item, I found that a few records were truncated. One example of this is below. The second record is the Exported one:

Formula: List := @DbLookup(“”; @DbName; “Configuration Profiles”; BusinessUnit; “FKeyword_Title_1”);@If(@IsError(List); “”; List);

Formula: List := @DbLookup(“”; @DbName; “Configuration Profiles”; BusinessUnit; “FKeyword_Title_1”);

I investigated with NotesPeek and found that the record was split over two Body subfields exactly at the point where the record was truncated.

Here is the info from NotesPeek:

record-type Text ; record #2183, offset 0x7778

length 99

font-id Swiss 10 pt Normal Black

text “List := @DbLookup(""; @DbName; "Configuration Profiles"; BusinessUnit; "FKey”

"word_Title_1\");"

name “Body”

type Composite

class NoCompute

flags Sign Seal

length 30,718

record-type Text ; record #0, offset 0x2

length 38

font-id Swiss 10 pt Normal Black

text “@If(@IsError(List); ""; List);”

This is a listing of the core of the Agent

Set body = doc.GetFirstItem(“Body”)

Set rtnav = body.CreateNavigator

If rtnav.FindFirstElement(RTELEM_TYPE_TEXTPARAGRAPH) Then

Set rtrange = body.CreateRange

Set rtnav2 = body.CreateNavigator

Set rtrange2 = body.CreateRange

Do

InputText = “”

Call rtrange.SetBegin(rtnav)

Call rtrange.SetEnd(rtnav)

Set rtnav2 = rtrange.Navigator

If rtnav2.FindFirstElement(RTELEM_TYPE_TEXTRUN) Then

Do

Call rtrange2.SetBegin(rtnav2)	

InputText  = rtrange2.TextRun

Print #fileNum2, inputText

Loop While rtnav2.FindNextElement(RTELEM_TYPE_TEXTRUN)

End If

Loop While rtnav.FindNextElement(RTELEM_TYPE_TEXTPARAGRAPH)

End If

Is this a bug or am I missing something?

Subject: Text is truncated when accessed using Rich Text Navigator

Correction. The first record is the Exported record. The second was the record from the Rich Text Navigator.