Need some help with richtext

I have the following code that I added to my iNotes60.nsf (mailfile) script library:

CoreEmailClasses>QuerySaveExtension

right after the line that says:

QuerySaveExtension = True

REM {Start - adding rich text to body of e-mail];

Call Source.Refresh 



Dim session As New NotesSession

Dim doc As NotesDocument	

Set doc = source.Document		



Dim richStyle As NotesRichTextStyle

Dim richText As New NotesRichTextItem(doc, "Body")		



Set richStyle = session.CreateRichTextStyle



Call richText.AppendText("The meeting is at ")

richStyle.Bold = True

Call richText.AppendStyle(richStyle)

Call richText.AppendText("3:00")

REM {End - adding rich text to body of e-mail];

for some reason it doesn’t append the rich text that I’m asking for (at all, not even as ‘unformatted’ text).

however, if I use the command:

Call Source.FieldAppendText(“Body”,“meeting is at 3:00PM”)

it works.

Any ideas on what I might be doing wrong or have is this a Lotus Notes limitation?

Thanks

Subject: need some help with richtext

You have to save (or simulate saving with SaveOptions=“0”) and close and re-open to see rich text changes made through the backend.

Subject: RE: need some help with richtext

Hi Ben, thanks for the response.

Do you mean:

  • save document

  • retrieve document via backend

  • make richtext changes via backend

?

how do you ‘close and re-open’ a document that was never saved?

Subject: RE: need some help with richtext

Andre’s post on this seems to be the most clear and comprehensive:

Tip: How to update rich text in a document that’s open and redisplay it without saving