| Barry MacDonnell's
Toolbox for WordPerfect
Macros, tips, and
templates for Corel® WordPerfect® for Windows®
| Page updated Dec 1, 2017
| Three calendar
macros that can -
• Create full-page monthly calendars (in portrait or landscape) with two small (previous/next) monthly calendars at the top; or
• Create yearly calendars, 12 months to a page, in several layouts; or
• 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:
(v1.05 - For WordPerfect 10 and later versions only) (Download)
Monthly calendar.wcm creates a monthly calendar on one (Letter- or
A4-size) page with two smaller (previous/next month) calendars at the
top of the page.
The calendars are created in WordPerfect
tables so you can type inside any table cell, format the text, etc. You can also select cells
and join them, if desired.
Several options are available from a dialog menu. [Screen shot of monthly macro calendar menu]
You can choose the month, year, number of sequential calendars, page size (letter, A4), orientation (portrait, landscape), page margins, page background (white, color, transparent), subtitle text, and footer text and/or date.
You can create as many as 120 sequential monthly calendars in one operation.
An option on the menu lets you specify whether the weeks should start on Sunday or Monday.
Several more formatting options are available in the redlined User Modification Area at the top of the macro's code. (You can view the options by opening the macro for editing, just like any regular WordPerfect document; here's how to download and modify macros from this site.)
You can set the defaults for the text labels used for the month (e.g., November) and week days in the User Modification Area. This also lets you use another language's text labels (e.g., Novembre) instead of English labels (e.g., November) on the calendars. [Note that this will change only the text labels on the printed calendars (and in the "Choose the Month" drop list on the menu), not the macro menu's other text.]
☼ Mark (emphasize) a date cell:
Text: Any contents in the calendar's table cells are not formatted by default. You can simply select any text (including the date numbers) and apply formatting such as bold, a text color, colored highlighting, etc.
Border: Left-click on any cell in a calendar to position the cursor in the cell (or click-and-drag to select several cells), then right-click to bring up the context menu. Choose Borders/Fill, then (in the Cell tab) choose Outside. Choose a heavy border, then choose a Color. Click OK to return to the document. The date cell will have a thick border around it.
Fill: Similar to applying a border, but use the "Cell Fill" column and choose a fill percent (e.g., 10%), and optionally a color (e.g., Yellow). For a simple macro to do this for one or more cells, see this post on WordPerfect Universe. (Several such macros, assigned to a toolbar, could help you use various colors for different events.)
Remove the border and fill changes by clicking the Border/Fill dialog icons and choosing "X" (none).
☼ Insert your favorite watermark image on the page(s). Select the Transparent option from the menu to allow the watermark to show through the calendar, then create the calendar(s). Position the cursor at the very top of the document, and click Insert, Watermark, Create. Insert your favorite image. Stretch the image to fill the watermark window. Adjust watermark shading from the watermark property bar, if desired. Click File, Close to return to the main document. [See also Footnote 1 below.]
☼ An option on the menu lets you split weekday (date) rows horizontally. See the User Modification Area at the top of the macro's code for various related options you can set as defaults: For example, you can shade the weekday rows (i.e., cells with day numbers); remove bottom cell border lines from the weekday number rows; or use a dashed or dotted line as dividing lines. Now you can more easily select and join cells across weekdays so that you can span several days with a space to write common information (e.g., "On vacation" or "Trip to London").
☼ You have the option to remove cell borders from all non-date cells (those cells before the first day and after the last day of each month); this might be useful on printed calendars to provide extra white space for writing notes or reminders on the calendar. [Note that cell borders are visible only if you disable (un-tick) WordPerfect's View, Table Gridlines. The cell border's guidelines are visible if you enable (tick) WordPerfect's View, Guidelines, Tables. For more on these features, see here.]
☼ You can place your cursor inside a table cell in the main calendar and insert clip art with Insert, Graphics, Clipart. The clip art image will be automatically sized to fit the table cell; right-click the image and choose Image Tools to adjust the Brightness to allow text to show through the graphic image.
☼ The two small calendars on each monthly calendar page are created with tables placed inside graphic boxes, which act as "containers" to hold the calendars. You can copy a box (use Reveal Codes to locate, select, and copy the [Box] code) and paste that box into another document where you might want to use a small (approximately 1.4" wide) calendar. The box can be dragged into position. Right-click the box for various options (which includes the choice, "Delete Box," in case you don't want these mini-calendars).
☼ See the redlined User Modification Area at the top of the macro's code to make changes to the menu or other default values. You can open a macro file (.wcm) just like any other WordPerfect document (.wpd), then save your edits with the Save & Compile button on the macro property bar that should appear under the program's main toolbar. (If that bar is not visible, use Tools, Macro, Macro Toolbar to display it.)
☼ Printing two calendars per page is easy with FinePrint (which can be used with any Windows program to save paper and ink/toner, preview printouts, print in various layouts including booklets, etc.). You can generate multiple monthly calendars in Landscape orientation, then simply print them "2-Up" in standard portrait mode with FinePrint from within WordPerfect. [Screen shot] (FinePrint is a well known commercial product. Not affiliated with the Toolbox for WordPerfect. Trial version available.)
(v1.04 - For WordPerfect 9 and later versions) (Download)
Annual calendars.wcm 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).
An option on the menu lets you specify whether the weeks should start on Sunday or Monday. You can now set the defaults for the text labels used for the month (e.g., November) and week days in the User Modification Area at the top of the macro's code (see last Tip below); this lets you use another language's text labels (e.g., Novembre) instead of English labels (e.g., November) on the calendars. Note that this will change only the text labels on the printed calendars.
Notes and tips
• For the two column/row formats, you can type text between the calendars. This makes these formats useful for announcements, meeting agendas, events, reminder lists, etc.
• You can choose to create the calendars in color or make them transparent so that a watermark will show through the calendars. [UPDATE: See Footnote 1 below.]
• You can also add a header and/or footer to the page.
• Calendars are created in 12 small tables of fixed sizes. Depending on your printer driver, you may need to adjust margins to make the 12 calendars fit on one page.
• A menu option lets you split weekday rows horizontally (N.B.: Full Page format only): Once split, select contiguous cells, right-click them, then choose Join Cells. You can then type information that spans multiple days. You can also apply a color "fill" to the joined cells by selecting the cells and right-clicking them, then choosing Borders/Fill, then Cell Fill to set the intensity.
• Once all calendars are created, you can edit the page and select a single calendar (or a six-month boxed calendar) to copy it to another document. Be sure to use Reveal Codes and select everything from the [Tbl Def] code to the [Tbl Off] code for the particular calendar you want to copy. Pasting a single calendar into a text box (that you can resize to "hug" the calendar) will let you drag the calendar to a new location; the text box can have body text wrapped around it by selecting the box, right-clicking it, and choosing Wrap.
• See the redlined User Modification Area at the top of the macro's code to make changes to the menu or other default values. You can set the menu and calendar text defaults by opening the macro like any other document and following the instructions at the top of the code. Then Save&Compile the macro from the property bar. For example, you can add your company name so that it appears automatically in the header text.
Find day of week.wcm
(v1.02 - For WordPerfect 8 and later versions) (Download)
Find day of week.wcm - "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.)
☼ If you need to quickly calculate and/or insert a date that is "x" days in the future (or the past) from today, you can use these small macroc: DATEINS (in the Library) or INSDATE.ZIP (direct download).
For advanced users:
☼ The "engine" (code routine) that does the work of finding the day of the week in this macro was also used in the Annual calendars macro above. It may be of interest to programmers who want to create their own monthly or yearly calendars with a macro. It was based on a mathematical formula called Zeller's Rule (see, for example, http://mathforum.org/dr.math/faq/faq.calendar.html or, more briefly, Footnote 2).
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) 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.
Zeller's Rule (from "The Calendar and the Days of the Week" - http://mathforum.org/dr.math/faq/faq.calendar.html)
• k is the day of the month. Let's use January 29, 2064 as an example. For this date, k = 29.
• m is the month number. Months have to be counted specially for Zeller's Rule: March is 1, April is 2, and so on to February, which is 12. (This makes the formula simpler, because on leap years February 29 is counted as the last day of the year.) Because of this rule, January and February are always counted as the 11th and 12th months of the previous year. In our example, m = 11.
• D is the last two digits of the year. Because in our example we are using January (see previous bullet) D = 63 even though we are using a date from 2064.
• C stands for century: it's the first two digits of the year. In our case, C = 20.
Need a smaller calendar for a single purpose (e.g., to 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."