Lotus Notes Teamroom – lotusscript table text/cell color

5 pts.
Tags:
Lotus Notes 7
Lotus Notes Teamroom
LotusScript
Im really new to using lotusscript, and Notes as well. I am using Lotus Notes/Domino 7 on Win Xp. I am using the Teamroom template database and i am running into some troubles coding. i modified the Teamroom in Domino by adding a basic table into the form, and each cell has a field for the user to input data. I need a certain column of the table, which has the heading "Status", to be able to let the user insert R for red, B for blue, G for green, etc. and have it auto set the color of the cell(ideally) to that corresponding color. I've seemed to have an easier time trying to get the font color to change. But this is what i have so far. Hopefully someone can give me some help with the font color, and maybe with the cell color. I am coding within one of the fields i need to change, it is named "Untitled_4", and i am using the Exiting event, so when they click off the rich text field it runs the code. So far all I can get to work is this(just for the color red). I know I can improve it by Trimming spaces and setting it to lowercase, but i'm just trying to get the basics to work. It just replaces the letter 'r' with 'RED': Sub Exiting(Source As Field) Dim workspace As New NotesUIWorkspace Dim uidoc As NotesUIDocument Set uidoc = workspace.CurrentDocument If (uidoc.FieldGetText("Untitled_4") = "r") Then Call uidoc.FieldSetText ( "Untitled_4" , "RED" ) End If End Sub However, I need the color of the 'Red' text to be red also. This next part is my attempt at it, but I am getting "Type mismatch" and "Object variable not set" errors. I'm Not sure why though. The "type mismatch" error has to do with the data variable but that's all I know. Sub Exiting(Source As Field) Dim session As New NotesSession Dim db As NotesDatabase Set db = session.CurrentDatabase Dim doc As NotesDocument Set doc = New NotesDocument(db) Dim data As Variant data = Lcase(Trim(doc.GetItemValue( "Untitled_4" ))) Dim richStyle As NotesRichTextStyle Set richStyle = session.CreateRichTextStyle richStyle.bold = True richStyle.NotesColor = COLOR_RED Dim richText As NotesRichTextItem Set richText = doc.GetFirstItem( "Untitled_4" ) If (data = "r") Then Call richText.AppendStyle(richStyle) Call richText.AppendText( "RED" ) End If End Sub Any help would be appreciated. thanks

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following