How to replace carriage returns with "<br>" in plain text, or alternative solution?

I’m using LotusScript agent to export Notes documents into HTML pages.

Everything is fine, except for one thing: I can’t preserve any paragraph or new line breaks within a text, when I convert richtext field content into plain text. using the following method: plainText$ = notesRichTextItem.GetUnformattedText( ).

Unfortunally I can’t modify the text in rtf fields directly, because it is used in other ways.

Is there any way somehow to identify a carriage return in LS and replace it by something else?

Thank you!

Subject: FOUND A SOLUTION: How to replace carriage returns with “
” in plain text, or alternative solution?

I found a nice script in this discussion, that does everything I need. To make it work, I just added text fields for the final output.

Here is a link: http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/a927e5ba323b231a85256f9b0052e731?OpenDocument

Subject: in some cased, this might work better

If doc.HasItem( “dbchange” ) Then

idbchange=doc.GetFirstItem(“dbchange”).Text

idbchange=Replace(idbchange,Chr(13) & Chr(10), “”)

'strip commas out, too

idbchange=Replace(idbchange,“,”,“”)

End If