Manage Learn to apply best practices and optimize your operations.

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)


Dig Deeper on Domino Resources - Part 3

SearchWindowsServer

Search400

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury

SearchDataCenter

SearchContentManagement

Close