Lotus Notes FAQ Visit Our Sponsor!

Can you make a popup calendar in Notes?

Put the following into text field and it will generate a calendar in your form. Make sure that the text area uses a fixed width font.

REM "Controllable spacing version from MStevenson@symantec.com";

TmpDate := @Date(@Today);

REM "HSP controls the horizontal size of the calendar.";
REM "Use 1 space for a really small calendar.";
REM "Default is 2 spaces.";
hsp := "  ";

REM "VSP controls the vertical size of the calendar";
REM "Default is 1 @Newline";
vsp := @Newline;

REM "DSP is used for the day headings";
dsp := hsp + " ";

REM "-------------------------- Calculate the days for this month";
A := @Adjust(TmpDate; 0; 0; -(@Day(TmpDate) - 1); 0; 0; 0);
A1 := @Weekday(A);
A2 := A;
A3 := @Month(A);
C1 := @Adjust(A2; 0; 0; (1 - A1); 0; 0; 0);
C2 := @Adjust(A2; 0; 0; (2 - A1); 0; 0; 0);
C3 := @Adjust(A2; 0; 0; (3 - A1); 0; 0; 0);
C4 := @Adjust(A2; 0; 0; (4 - A1); 0; 0; 0);
C5 := @Adjust(A2; 0; 0; (5 - A1); 0; 0; 0);
C6 := @Adjust(A2; 0; 0; (6 - A1); 0; 0; 0);
C7 := @Adjust(A2; 0; 0; (7 - A1); 0; 0; 0);
C8 := @Adjust(A2; 0; 0; (8 - A1); 0; 0; 0);
C9 := @Adjust(A2; 0; 0; (9 - A1); 0; 0; 0);
C10 := @Adjust(A2; 0; 0; (10 - A1); 0; 0; 0);
C11 := @Adjust(A2; 0; 0; (11 - A1); 0; 0; 0);
C12 := @Adjust(A2; 0; 0; (12 - A1); 0; 0; 0);
C13 := @Adjust(A2; 0; 0; (13 - A1); 0; 0; 0);
C14 := @Adjust(A2; 0; 0; (14 - A1); 0; 0; 0);
C15 := @Adjust(A2; 0; 0; (15 - A1); 0; 0; 0);
C16 := @Adjust(A2; 0; 0; (16 - A1); 0; 0; 0);
C17 := @Adjust(A2; 0; 0; (17 - A1); 0; 0; 0);
C18 := @Adjust(A2; 0; 0; (18 - A1); 0; 0; 0);
C19 := @Adjust(A2; 0; 0; (19 - A1); 0; 0; 0);
C20 := @Adjust(A2; 0; 0; (20 - A1); 0; 0; 0);
C21 := @Adjust(A2; 0; 0; (21 - A1); 0; 0; 0);
C22 := @Adjust(A2; 0; 0; (22 - A1); 0; 0; 0);
C23 := @Adjust(A2; 0; 0; (23 - A1); 0; 0; 0);
C24 := @Adjust(A2; 0; 0; (24 - A1); 0; 0; 0);
C25 := @Adjust(A2; 0; 0; (25 - A1); 0; 0; 0);
C26 := @Adjust(A2; 0; 0; (26 - A1); 0; 0; 0);
C27 := @Adjust(A2; 0; 0; (27 - A1); 0; 0; 0);
C28 := @Adjust(A2; 0; 0; (28 - A1); 0; 0; 0);
C29 := @Adjust(A2; 0; 0; (29 - A1); 0; 0; 0);
C30 := @Adjust(A2; 0; 0; (30 - A1); 0; 0; 0);
C31 := @Adjust(A2; 0; 0; (31 - A1); 0; 0; 0);
C32 := @Adjust(A2; 0; 0; (32 - A1); 0; 0; 0);
C33 := @Adjust(A2; 0; 0; (33 - A1); 0; 0; 0);
C34 := @Adjust(A2; 0; 0; (34 - A1); 0; 0; 0);
C35 := @Adjust(A2; 0; 0; (35 - A1); 0; 0; 0);
C36 := @Adjust(A2; 0; 0; (36 - A1); 0; 0; 0);
C37 := @Adjust(A2; 0; 0; (37 - A1); 0; 0; 0);

REM "----------------------------------- Create display values";
B1 := @If(@Month(C1) != A3; "  "; @Right("0" + @Text(@Day(C1)); 2));
B2 := @If(@Month(C2) != A3; "  "; @Right("0" + @Text(@Day(C2)); 2));
B3 := @If(@Month(C3) != A3; "  "; @Right("0" + @Text(@Day(C3)); 2));
B4 := @If(@Month(C4) != A3; "  "; @Right("0" + @Text(@Day(C4)); 2));
B5 := @If(@Month(C5) != A3; "  "; @Right("0" + @Text(@Day(C5)); 2));
B6 := @If(@Month(C6) != A3; "  "; @Right("0" + @Text(@Day(C6)); 2));

REM "These days always have values, so do not bother with the extra check";
B7 :=  @Right("0" + @Text(@Day(C7)); 2);
B8 := @Right("0" + @Text(@Day(C8)); 2);
B9 := @Right("0" + @Text(@Day(C9)); 2);
B10 := @Right("0" + @Text(@Day(C10)); 2);
B11 := @Right("0" + @Text(@Day(C11)); 2);
B12 := @Right("0" + @Text(@Day(C12)); 2);
B13 := @Right("0" + @Text(@Day(C13)); 2);
B14 := @Right("0" + @Text(@Day(C14)); 2);
B15 := @Right("0" + @Text(@Day(C15)); 2);
B16 := @Right("0" + @Text(@Day(C16)); 2);
B17 := @Right("0" + @Text(@Day(C17)); 2);
B18 := @Right("0" + @Text(@Day(C18)); 2);
B19 := @Right("0" + @Text(@Day(C19)); 2);
B20 := @Right("0" + @Text(@Day(C20)); 2);
B21 := @Right("0" + @Text(@Day(C21)); 2);
B22 := @Right("0" + @Text(@Day(C22)); 2);
B23 := @Right("0" + @Text(@Day(C23)); 2);
B24 := @Right("0" + @Text(@Day(C24)); 2);
B25 := @Right("0" + @Text(@Day(C25)); 2);
B26 := @Right("0" + @Text(@Day(C26)); 2);
B27 := @Right("0" + @Text(@Day(C27)); 2);
B28 := @Right("0" + @Text(@Day(C28)); 2);
B29 := @Right("0" + @Text(@Day(C29)); 2);

B30 := @If(@Month(C30) != A3; "  "; @Right("0" + @Text(@Day(C30)); 2));
B31 := @If(@Month(C31) != A3; "  "; @Right("0" + @Text(@Day(C31)); 2));
B32 := @If(@Month(C32) != A3; "  "; @Right("0" + @Text(@Day(C32)); 2));
B33 := @If(@Month(C33) != A3; "  "; @Right("0" + @Text(@Day(C33)); 2));
B34 := @If(@Month(C34) != A3; "  "; @Right("0" + @Text(@Day(C34)); 2));
B35 := @If(@Month(C35) != A3; "  "; @Right("0" + @Text(@Day(C35)); 2));
B36 := @If(@Month(C36) != A3; "  "; @Right("0" + @Text(@Day(C36)); 2));
B37 := @If(@Month(C37) != A3; "  "; @Right("0" + @Text(@Day(C37)); 2));

ShowMonth := @Select(@Month(A2); "January"; "February";
 "March"; "April"; "May"; "June"; "July"; "August";
 "September"; "October"; "November"; "December");

REM "---------------------- Display the calendar";
sp + sp + sp + ShowMonth + " " + @Text(@Day(TmpDate)) + ", " + @Text(@Year(A2)) + vsp +

" " + "S" + dsp + "M" + dsp + "T" + dsp + "W" + dsp + "T" + dsp + "F" + dsp + "S" + vsp +
B1 + hsp + B2 + hsp + B3 + hsp + B4 + hsp + B5 + hsp + B6 + hsp + B7 + vsp +
B8 + hsp + B9 + hsp + B10 + hsp + B11 + hsp + B12 + hsp + B13 + hsp + B14 + vsp +
B15 + hsp + B16 + hsp + B17 + hsp + B18 + hsp + B19 + hsp + B20 + hsp + B21 + vsp +
B22 + hsp + B23 + hsp + B24 + hsp + B25 + hsp + B26 + hsp + B27 + hsp + B28 + hsp + vsp +
B29 + hsp + B30 + hsp + B31 + hsp + B32 + hsp + B33 + hsp + B34 + hsp + B35 + hsp + vsp +
B36 + hsp + B37


Applies to Notes Versions: 3 4 4.5 4.6 5
Last Modified: August 8, 1998