Text Formatting Using Rich Text Field

I have a form that contains a rich text field, which is accessible over the web.

I have it set to display Using Java Applet. When I enter in the formatted text - bold, underline, etc. the formatting is saved in the document.

I am then using an agent to pick up the information and display it on the web.

Forall item In doc.Items

If item.Name = “Details” Then

sDetail = item.Text

Exit Forall

End If

End Forall

However, when the data (sDetail) is displayed, it appears as one line, with no text formatting.

I also tried to use .GetFormattedText, but that didn’t work either.

Any suggestions or a nudge in the right direction would be greatly appreciated. Thanks in advance.

Subject: Text Formatting Using Rich Text Field

The problem is a lot more complicated than you might think. In plain-Jane LotusScript, all you have access to is GetFormattedText and GetUnformattedText (and Text by way of polymorphism). Both of these return string data, the only real difference being what happens to tabs and carriage returns. Neither preserves colour, weight, style or font size.

If you want anything like fidelity to the original data, you need to get knee-deep in the rich text. As long as you don’t need anything too spectacular, you can use either a NotesRichTextNavigator to go through the item run-by-run, or you can do essentially the same thing by parsing exported DXL. There is also the C API option (which I can’t be too detailed in helping you with), or a third-party tool (particularly the Midas Rich Text LSX, which I know does good CD-to-HTML conversion).

Subject: RE: Text Formatting Using Rich Text Field

Complicated is right! Thanks for your response Stan.

I may check into the NotesRichTextNavigator, but I am not familiar with DXL or interested in any third-party tool.

Appreciate the help!