| Barry MacDonnell's
Toolbox for WordPerfect
Macros, tips, and
templates for Corel® WordPerfect® for Windows®
| Page updated Dec 7, 2013
| Three calendar
macros that can -
(1) create full page monthly calendars (in portrait or landscape) with two small (previous/next) monthly calendars at the top; or
(2) create yearly calendars, 12 to a page, in several layouts; or
(3) quickly find the day of the week a date falls on (e.g., October 26, 2004 was a Tuesday).
Here is probably more than you ever wanted to know about calendars and related oddities:
(Somewhat) related information on this site:
From other macro authors:
Monthly calendar.wcm (v1.05 - For WordPerfect 10 and later versions only)
Creates a monthly calendar on one (Letter- or A4-size) page with two smaller (previous/next month) calendars at the top of the page. Many formatting options are available from a pop up menu. You can also create up to 120 sequential monthly calendars in one operation.
Annual calendars.wcm (v1.04) - (For WordPerfect 9 and later versions)
Creates 12 monthly calendars on one portrait-oriented
page (Letter size, A4, etc.), in three different layouts --
Full Page, or
Two Columns (left and right sides of page), or
Two Rows (top and bottom of page).
NOTES and TIPS
Find day of week.wcm (v1.02) - (For WordPerfect 8 and later versions; may also work in earlier versions)
"Perpetual calendar" - Select a month, day, and year form a menu and the macro will tell you what day of the week the date falls on. Useful for any date since about the time the Gregorian calendar was introduced in A.D. 1582. (The macro input field is limited to dates from A.D. 1600-2400, but the macro was not tested with far future dates.)
TIP (for advanced users)
Intermediate to Advanced users:
Until I get around to modifying the macro's code with new features to incorporate ideas such as the following, you could create one or more macros that insert a graphic image as a full-page watermark, similar to the one shown in the example page linked above. They could be chosen from a small menu, similar to the way other items can be attached to menus (described here). You would simply create a calendar and play the appropriate image-inserting macro.
In the following example code (created by recording a macro in WP220.127.116.110) you will need to change the path and name of the graphic image in the BoxImageRetrieve() command to the path and name of the image on your own system. Also, if you use the A4 paper size, change the dimensions in the BoxWidth() command to 8.3" and the box height() command to 1.7".
Zeller's Rule (from "The Calendar and the Days of the Week" - http://mathforum.org/dr.math/faq/faq.calendar.html)
Footnote 3Need a smaller calendar for a single purpose (insert in an announcement, newsletter, web page, etc.)?
You can create a small table to do th job. [From my post on OfficeCommunity.com, 8/29/2013, where a user needed a monthly calendar for just the current month with the dimensions of 3.5" wide by 4.875" tall:]
"Calendars produced in WordPerfect are created with tables, so the custom calendar would have to be set up to match your custom size.
This can be done with a macro but I doubt such a custom size exists -- unless someone has created one and jumps in here to post it.
Meanwhile, as a workaround, you could manually create a template for such a calendar -- an empty version without dates -- with a table having the custom size dimensions containing a title row (e.g., September), a weekday row (S, M, T, ... ), and 5 empty rows for the days.
That is, a 7 x 7 table, which should only take a few minutes (initially) to set up. After that the formatted table will be instantly available.
(The entire process below worked perfectly in my tests.)
Since your custom calendar table is 3.5" wide, each column would be 0.500" wide. I used this dimension for the 7 columns, and set the column width to "Always keep width the same" and the column margins to a small amount: 0.050".
Each row would be 0.696" high (4.875" divided by 7). I also set the row margins to 0.100" and chose "Single line only."
The title row's cells (row 1) can be joined into one cell be selecting them and using Table, Join, Cell.
Once you have added the weekday row labels (S,M,T,W,T,F,S -- justified center, and perhaps in a 12-point font), and justified the remaining rows that will contain the numbers, you can create a custom template and save it to disk. See [here].
When you load a new document based on that template, you can insert the dates very quickly with a small macro such as the following one. (You will need to enter the last day of the calendar month on the vTotalDays command. Or, you could just set it at 31 and later delete the extra days in the final calendar when needed.)
Just put the cursor in the cell where the first date should be, then play the macro. It will add the date numbers in 8-point font.
// Macro begins
To copy this code into your WordPerfect program to create a working macro, see [here].
You can edit the custom template to adjust the various row heights to produce a more pleasing layout, then save it back to disk."