Change Text Color Of Any Richtext Field Background
Using NotesRichTextStyle Class you can change of color or format of any text
within RichText Item Background. Code is an example for Mail
Dim sess as New NotesSession
Dim memo as New Notesdocument(sess.CurrentDatabase)
Dim rt as New NotesRichTextItem(memo,"Body")
Dim style as NotesRichTextStyle
Set style=sess.CreateRichTextStyle
memo.SendTo="Lotus 411"
memo.Subject="Test"
Call rt.AppendText("This is a test mail to test RichText style Class")
Call rt.AddNewLine(2)
'Here is code which changes code to RED/BOLD/UNDERLINE
style.Bold=True
style.UnderLine=True
style.NotesColor=COLOR_RED
Call rt.AppendStyle(style)
Call rt.AppendText(" D A N G E R")
Call memo.Send(False)
'Above code will render DANGER in RED BOLD UNDERLINE Format
'If you are trying add text after this make sure you clear properties set for
style ,other wise it render text after in RED color.
to Clear
style.Bold=False
style.UnderLine=False
style.NotesColor=COLOR_BLACK
Call rt.AppendText(style)