How to Add Text to a Rich Text Object
Unlike a text field, where you assign a text string to an object, a Rich Text field requires additional statements using the NotesRichTextItem class. The methods and properties associated with this class enable you to insert text strings and format a Rich Text field.
How It Works
In order to reference a Rich Text field, you must instantiate a NotesRichTextItem object. Then using methods such as AddNewLine and AppendText, you can change the text and appearance of the Rich Text object.
Implementation
To insert text in a new Rich Text field, you must obtain a handle to a document (doc) and create a NotesRichTextItem object. The following will insert a single blank line, the statement "This is a test", and another blank line in a field called ATTACHMENTS. To implement this code, replace ATTACHMENTS with the appropriate Rich Text field name.
Dim s As NotesSession Dim db As NotesDatabase Dim doc As NotesDocument Dim rtitem as NotesRichTextItem Set s = New NotesSession Set db = s.CurrentDatabase Set doc = New NotesDocument (db) Set rtitem = New NotesRichTextItem(doc, "ATTACHMENTS") Call rtitem.AddNewLine(1) Call rtitem.AppendText("This is a test") Call rtitem.AddNewLine(1)