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.
How to Edit the Template
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.
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.
Faster Editing Method
Give your Windows user account Modify permission to the Templates folder. Make a copy of the template file then edit the original in-place. You can leave the Calendar Printing Assistant open when you edit the catx.
For a step-by-step tutorial of the faster editing method, see My Speedy CPAO Modification Method
To view the changes in CPAO, select a different template then the template you are editing to refresh it.
If you receive an error, select a different template then fix your template and reselect it.
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".
- You can use any zip utility to open the catx file provided it allows you to edit and update the contents.
- Editing the catx from the Templates folder may fail with read only errors.
- 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.
- When adding attributes leave 1 space between the new attribute and the existing attributes.
- Font size of 7 pt is used for the small monthly calendars, footer, and banners.
- I mention the template name I tested the attribute in but they should work in other templates of the same type.
- Don't be afraid to experiment - the worst thing that can happen is you'll need to restore the template copy.
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.
- VerticalAlignment="Bottom" - Valid attributes include Top.
- HorizontalAlignment="Right" - Valid attributes include Left and Center.
- 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.
- Background="color_name" - As the name suggests, this controls the background color in elements. Use this to override theme colors applied using Styles.
- FontSize="10pt" Any reasonable font size should work. I have not tried other measurements common in CSS code.
- FontWeight="Bold" - Valid attributes include Normal
- 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. .
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.
Days of the week
These are in the WeekHeader section in the
<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.
Style="LevelOneBody" in the Month Overview provides the lines visible in each square.
<WeekGrid Orientation="Fill" NumRows="Auto" NumColumns="7" LastRowMerge="2" Style="LevelOneBody">
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.
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
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>
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.
<!-- 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>
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">
If you want to print just the working days in a monthly calendar, you need to edit the following two line by adding UnitFilter="mon..fri" at the end (following the Style parameter). You'll also to change NumColumns="7" to NumColumns="5".
WeekHeader Orientation="Top" Height="0.3in" FontSize="10pt" Format="dddd" Style="LevelOneTitle"
StandardGrid Orientation="Fill" NumRows="1" NumColumns="7" Style="LevelTwoBody"
This is an edited content.xml for the Month_StandardMonthWithWeeks01 template. You can open it, select all, copy and paste into the Content.xml (after selecting all of the text in it).
Mod to Print Category Colors on Calendar Using CPA
In a thread at Outlook Forums, a user asked how to change the calendar color to category color: "There appears to be small colored dots in front of listed appointments, but they are all the same color. I'm hoping there is a way to colorize the entire appointment based on the category colors from Outlook 2007. The all day appointments are colorized, so I'm hoping there is a way to do that for the others, with each person having their own color based on the Outlook 2007 category color."
DanHoff reports in that thread that you can replace "[CalendarColor]" with "[CategoryColor]" as long as you're using a calendar that shows colors per calendar. You'll make this change in the *.calx, not the template (catx).
Modify monthly calendar template to show only working days (Outlook Forums)
Calendar Printing Assistant for Outlook(Microsoft)
More at Slipstick.com
- Calendar Printing Assistant Shows Duplicate Entries
- Calendar Printing Assistant: Week Starts on Sunday or Monday
- How to Email Calendar Printing Assistant Calendars
- More CPAO Template Modifications
- My Speedy CPAO Modification Method
- Printing a Calendar Legend
- Using and Editing the My Outlook Calendar Template