Modify Calendar Printing Assistant Templates

We're often asked how to create or modify templates for the calendar printing assistant. While there isn't a whole lot you can do to change the templates (without getting deep in editing the XML), its very easy to tweak the text formatting, including font size and position.

The calendar printing assistant uses a template with the extension *.catx. It's stored in the Office template folder, typically located at C:\Program Files\Microsoft Office\Templates. Locate the template you want to edit. Select it, press Ctrl+C then Ctrl+V to make a backup copy in the Templates folder.

My safe method: copy the .catx file to My Documents and open it with WinZip by right clicking on the catx file and choosing Open with... then browse for WinZip.exe. (If WinZip is not installed you will need to download and install it). Use the Explorer view in WinZip (View menu, Files by Folder) and locate the Content.xml in the Cal folder. Right click on content.xml and choose Edit to open it in Notepad. When editing is finished, click Save in Notepad (don't close it) then click on the WinZip window and approve the update. Copy the catx back to the Templates folder and approve replacing the catx in the Templates folder. 

Faster method: Give your windows user account Modifiy permission to the Templates folder. Make a copy of the template then edit the original in-place.

You can leave the Calendar Printing Assistant open when you edit the catx. if you receive an error, select a different template. After copying the edited catx to the Templates folder, select the template to view changes in the CPA. If you need to make more changes, edit the file in Notepad, Save then copy the catx to the Templates folder and reselect the template in CPA.

Task Pad menusUsing Predefined Colors, Fonts and Styles

Before changing colors by editing the XML, use the Color task pane to apply different themes. Colors and Fonts are applied in the XML with Style="style_name".

 

 

Notes:

  1. You can use any zip utility to open the catx file provided it allows you to edit and update the contents.
  2. Editing the catx from the Templates folder may fail with read only errors.
  3. If you enter an attribute that is invalid, the CPA will notify you and include the line number where the invalid attribute can be found.
  4. When adding attributes leave 1 space between the new attribute and the existing attributes.
  5. Font size of 7 pt is used for the small monthly calendars, footer, and banners.
  6. I mention the template name I tested the attribute in but they should work in other templates of the same type.
  7. Don't be afraid to experiment - the worst thing that can happen is you'll need to restore the template copy.

Valid attributes

The following is a list of some of the valid attributes you can use. This list is by no means complete and is only intended to give beginners an idea of what can be changed.

  1. VerticalAlignment="Bottom"   - Valid attributes include Top.
  2. HorizontalAlignment="Right" - Valid attributes include Left and Center.
  3. Foreground ="color_name"  - This is used for font colors. You can use names (Red) or Hex codes (#00FF00). Any valid CSS color name will probably work. Use this to override theme colors applied using Styles.
  4. Background="color_name" - As the name suggests, this controls the background color in elements. Use this to override theme colors applied using Styles.
  5. FontSize="10pt"  Any reasonable font size should work. I have not tried other measurements common in CSS code.
  6. FontWeight="Bold" - Valid attributes include Normal
  7. Format="dddd"  - Name format for the day of the week, dddd is full name (Monday, Tuesday etc) Use ddd for abbreviated format (Mon, Tue, Wed etc) and d for M, T, W format. .

Edit the Day Format

To change the formatting within an individual day cell, look for the DAYFORMAT tag (may be near the end of the file) and locate the CalendarText tag under DAYFORMAT.

For example, in the standard monthly calendar 1 (Month_StandardMonth01.catx), day format is at approx row 87:
<DayFormat>
<Grid RowSetting="*" ColumnSetting="*" Height="Auto" Style="LevelLeafParent">
<CalendarText Row="0" Column="0" FontSize="24pt" FontWeight="Bold" Text="#[%d]" FontFamily="style!FontMajor" VerticalAlignment="Bottom" HorizontalAlignment="Right" >

I added VerticalAlignment="Bottom" HorizontalAlignment="Right" to the calendar text row and changed FontSize to 24pt.You can change FontWeight to Normal (other valid weights may be supported, I only tested it with Normal).

The following screen shots show the original and edited template.

Calendar Printing Assistant Template (original) Calendar Printing Assistant Template (edited)

Days of the week

These are in the WeekHeader section in the <MonthFormat> (Monthly calendars)

 <WeekHeader Orientation="Top" Height="0.3in" FontSize="10pt" Format="dddd" Style="LevelOneTitle"/>

This screen shot shows the font size used by the day of the week name set at 20 pt. You can use ddd for the Format if you want Mon, Tue etc.

Calendar Printing Assitant days of the week

Grid lines 

Grid LinesStyle="LevelOneBody" in the Month Overview provides the lines visible in each square.

 <WeekGrid Orientation="Fill" NumRows="Auto" NumColumns="7" LastRowMerge="2" Style="LevelOneBody">

Month and Calendar Thumbnails Section

do you wish you have more calendar thumbnails or had next month and the month after shown, instead of last month and next month? You can if you edit the Content.xml. This sample is from the standard monthly calendar but the process is similar for every calendar.

In this screen shot, I added 4 calendars, changed the grid background to  blue, the font size and color used by the month name after applying a color theme.
Standard Month Calendar

<!-- For each thumbnail calendar you want to add, you need to add a column setting of 1.3in. Four calendars is pretty much the limit for portrait layout. Add background="color" if you want to change the background color of the Grid row where the Month name and thumbnail calendars are shown. -->

<Grid Row="1" Column="1" RowSetting="Auto" ColumnSetting="*,1.3in,1.3in,1.3in,1.3in" Style="Header" Padding=".08in" Background="Blue">
<!--Month Title-->
<CalendarText Row="0" Column="0" Text="#[@TemplateDate_MonthNameYearNumber]" HorizontalAlignment="Left" FontSize="20pt" FontWeight="Bold" Foreground="Pink"/>
<!--Banners-->

<!-- Copy and paste the section beginning with <MonthWeekDayCalendar and ending with </MonthWeekDayCalendar> for each additional thumbnail calendar. Make changes as noted for each calendar -->

<!-- Each calendar needs a different Column number - for 4 calendars, you'll use numbers 1 through 4. -->
<MonthWeekDayCalendar Row="0" Column="1" Height="1.1in" Width="1.25in" VerticalAlignment="Center" HorizontalAlignment="Center" Style="BannerControl">

<!-- Change the DateOffset: -1 is last month, 0 is this month, 1 is next month, 2 is the month after that, etc -->
<MonthFormat DateOffset="-1">

<DockPanel>
<CalendarText Orientation="Top" Text="#[@TemplateDate_BannerMonthNameYear]" Height="0.19in" FontSize="8pt" Style="BannerTitle"/>
<WeekHeader Orientation="Top" Height="0.15in" FontSize="10pt" Format="d" Style="BannerWeekHeader"/>
<StandardGrid Orientation="Fill" NumColumns="1" NumRows="6" Style="BannerBody" />
</DockPanel>
</MonthFormat>
<WeekFormat>
<DockPanel>
<CalendarText Orientation="Left" Width="0.15in" Text="#[@TemplateDate_WeekNumber]" FontSize="5pt" Style="BannerText" HorizontalAlignment="Left" Margin="1,0,0,0">
<ConditionalFormat Condition="ShowWeekNumber eq 'false'" Visibility="Collapsed"/>
</CalendarText>
<StandardGrid Orientation="Fill" NumRows="1" NumColumns="7" />
</DockPanel>
</WeekFormat>
<DayFormat>
<Banner Text="#[%d]" FontSize="7pt" VerticalAlignment="Bottom" HorizontalAlignment="Right" Style="BannerText">
<ConditionalFormat Condition="OutsideMonthDays eq 'true'" Visibility="Collapsed"/>
<ConditionalFormat Condition="DayOfWeek eq 'sun'" Foreground="style!WeekendColor" ForegroundHighlight="style!WeekendColor"/>
<ConditionalFormat Condition="DayOfWeek eq 'sat'" Foreground="style!WeekendColor" ForegroundHighlight="style!WeekendColor"/>
</Banner>
</DayFormat>
</MonthWeekDayCalendar>

Footer Text

Each element in the footer (date printer, page number and username) is on a separate line at the end of the XML. You can remove any or all of these elements from the footer by deleting the line (or lines) you want removed or edit the footer to add or change text as shown below.

 Custom CPA Footer

 <!-- Standard Footer -->
<Grid Row="4" Column="1" VerticalAlignment="Top" Margin="0,4,0,0" RowSetting="Auto" ColumnSetting="*,*,*">
<CalendarText Row="0" Column="0" Date="#[Now]" Text="Printed on #[@TemplateDocInfo_PrintTime]" HorizontalAlignment="Left" FontSize="7pt" />
<CalendarText Row="0" Column="1" Text="Page #[@TemplateDocInfo_Page]" HorizontalAlignment="Center" FontSize="10pt" Foreground="Blue"/>
<CalendarText Row="0" Column="2" Text="Printed by User Acct #[@TemplateDocInfo_UserName]" HorizontalAlignment="Right" FontSize="10pt"/>
</Grid>

Show/Hide previous and next month's dates in the Monthly Calendar

UnitRestriction in the following line, from the Standard Month 01 Letter calendar, controls whether or not you'll see the dates of previous or next month. False shows the dates, True hides the dates. If the attribute is not present, the default is True (hide the dates).

 <WeekGrid Orientation="Fill" NumRows="Auto" NumColumns="7" Style="LevelOneBody" UnitRestriction="false">

  Month - days from last month Month - no days from last month

Links

Calendar Printing Assistant Modifications - add your own modifications in the Comments section

Modify the Calendar Printing Assistant Templates (EMO 10/16/2008)