Different text fonts/sizes/color in RichText field?

Greetings!

I have a LotusScript routine that reads some data and populates a “doc.Body” field in a Memo form.

After completion, this routine performs the “doc.Send” command and the message is sent. So far, so good…

But I was wondering if is there any way to, while populating this RichText field, according to some conditions, change the text attributes such as color, font, size…

The idea is to highlight some data in tis RT field.

Is that possible?

Something like this…

get data

if there´s no data then end this routine

analyze data

if data = YYY then

set font color to blue (but just for the next entry)

else

set font color to black (but just for the next entry)

end if

RTField = new line + data

Subject: Different text fonts/sizes/color in RichText field?

Here is some code to do it:

Dim normalstyle As NotesRichTextStyle

Dim highstyle As NotesRichTextStyle

Set normalstyle = session.CreateRichTextStyle

normalstyle.Bold = False

normalstyle.NotesColor = COLOR_BLACK

normalstyle.FontSize = 8

Set highstyle = session.CreateRichTextStyle

highstyle.Bold = True

highstyle.NotesColor = COLOR_RED

highstyle.FontSize = 8

Call rtitem.AppendStyle(normalstyle)

Call rtitem.AppendText(“normal text”)

Call rtitem.AppendStyle(highstyle)

Call rtitem.AppendText(“highlighted text”)

Call rtitem.AppendStyle(normalstyle)

Call rtitem.AppendText(“more normal text”)

Subject: RE: Different text fonts/sizes/color in RichText field?

Hi Rob

Great idea! It might solve the problem in a very simple way.

But I need a little more help…

I want to insert the text resulting of all this combination into the “Body” field of a Memo, to send it.

So, I am collecting the text, with its formats, in “rtitem”, right?

Questions:

Do I have to “DIM” rtitem?

How do I insert the contents of “rtitem” (with all the formatting gathered) into the “Body” field of a Memo?