Ask the Expert

Displaying info from rich text field

How can I display some info from a richtext field in a view - or even just flag that there is some info in an Rt field (by an icon ??)
You can display the text from a rich text field in a view by creating another field that contains the "text-only" contents of the rich text field and display that in your view. You could use the GetFormattedText method of NotesRichTextItem to do this in a closing event for your form.

Example....
.... where NotesDoc is your existing variable pointing to the NotesDocument
.... object you're working with and "converted_rich_text" is the new field you
.... want to create containing the text that is in your Rich Text field

Sub QueryClose
dim plain_text as string
dim rich_text_item as NotesRichTextItem
set rich_text_item = NotesDoc.GetFirstItem( "RichTextItemName_Here" )
plain_text = notesRichTextItem.GetFormattedText( strip_tabs,length_of_line )
Call NotesDoc.ReplaceItemValue( "converted_rich_text", plain_text )
End Sub

This was first published in February 2001

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: