How do I change the text color in an existing field??? (v4.6)
Posted on 1999-11-10
Through script, how do you change the text color of an existing field in an existing document?
I have experimented with 'NotesRichTextItem' and 'NotesRichTextStyle' but to no avail. Can someone please provide me with a quick snippet of code that will accomplish this?
Here is my code which doesn't work. What I am trying to do here is change a field's text color to red as soon as the field is entered in edit mode.
Sub Entering(Source As Field)
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
myfield = uidoc.CurrentField
Dim richStyle As NotesRichTextStyle
Set richStyle = session.CreateRichTextStyle
Dim richText As New NotesRichTextItem(doc, myfield)
richStyle.NotesColor = COLOR_RED
Call doc.save(True, False)