1.新建一个form命名为“fProfColor”用于编辑profiledocument,form设计如图:
其中“$txtColor”域为计算域,其value为:
"color0:=/"00ffffff/":/"00000000/";
color6:=/""+bColor6+"/":/""+fColor6+"/";
sD:=@Date(txtDueDate);
eD:=@If(txtCompletedDate=/"/";@Date(@Now);@Date(txtCompletedDate));
@If(txtCompletedDate=/"/" & eD<=sD;color0;
@Do(
days:=(eD-sD)/86400;
color1:=/""+bColor1+"/":/""+fColor1+"/";
color2:=/""+bColor2+"/":/""+fColor2+"/";
color3:=/""+bColor3+"/":/""+fColor3+"/";
color4:=/""+bColor4+"/":/""+fColor4+"/";
color5:=/""+bColor5+"/":/""+fColor5+"/";
days1:="+@Text(DelayedDays1)+";
days2:="+@Text(DelayedDays2)+";
days3:="+@Text(DelayedDays3)+";
days4:="+@Text(DelayedDays4)+";
days5:="+@Text(DelayedDays5)+";
@If(days1!=-1&days<=days1;color1;
days2!=-1&days<=days2;color2;
days3!=-1&days<=days3;color3;
days4!=-1&days<=days4;color4;
days5!=-1&days<=days5;color5;
color6)
))"
2.添加一个Action在menu中或view显示,用来打开profiledocument:
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim profDoc As NotesDocument
Dim saveFlag As Variant
Set db = ws.CurrentDatabase.Database
Set profDoc = db.GetProfileDocument("fProfColor")
saveFlag = ws.DialogBox("fProfColor",True,True,False,False,False,False,"Set color for Actions",profDoc,True,False,False)
If saveFlag=True Then
Call profDoc.Save(True,False)
End If
3.视图设置
插入新列到视图第一行,设置列属性。
在Column info页中设置title为“Color(hidden)”,勾上“Use Value as color”和“User definable”选项,设置"Profile document"为“fProfColor”。
在Advance页中设置name为“$txtColor”, 勾上“Hide Column”选项。
最后给该列随便设个value,如@UserName.
4.效果图