Wednesday, 30 May 2007

Yearly Calendar view for Outlook

A year view of your Outlook calendar

YearlyCalendar - download the code (free)

*** NOTE: new version available here ****

Castellano Deutsch Français Nederlands Italiano


You want to display, print or share more than one month of your Outlook Calendar? You want to view an entire year in the Calendar?
You'll love this macro, then. I couldn't find any free tool like this on the Internet, so I made one.


You can specify to view 1, 2, 3, .... 12 months at a time.
Your calendar will be displayed in an Internet Explorer window (but you can also open it in any other browser, as it is a simple html file).

Tips:
  • If you want to print out your calendar, you can use the view options of IE (view/text size/smallest) to squeeze a maximum of info on a page.
  • You can easily adapt the code to filter out certain categories of appointments (contact me if you have trouble).
  • You can decide to not display private appointments.
  • Print out an empty calendar and use it for handwritten scheduling.

outlook-tips.net says
"The following blog lists a VB Code sample for a yearly planner style calendar. It reads your default Outlook calendar and creates a HTML calendar. Supports up to 12 months. Code can be adapted to filter out categories. [...]
I tested it with Outlook 2007 and it works great. You can create a 1 -12 month calendar and print it, email it, or publish it to the web."

Other interesting articles
  • "Ciao Graziella," - A Reply button for your Outlook that fills in the recipients first name and greets them in their language.
  • Scheduling a big meeting? The only date where all participants are available is next year? How about a date where 9 out of 10 invitees are free?
  • Is your calendar so full of little reminders that you can't find your meetings anymore? How to hide the forest so you can see the big trees.
  • Print out your open reminders.
  • Getting Things Done - with Word and Outlook. Write up your projects in Word Outline mode, extract Outlook appointments and tasks for you Next Actions automatically.

67 comments:

BJM said...

This is very cool - and very much appreciated! Thank you for sharing
~BJM

mark said...

This is extremely cool!!! I've recently had jobs dealing with VBA, learning on my own. I've never had to do anything in Outlook VBA until now, and i can just say: Thank God people like you exist! Keep up the good work!

marc said...

Nice tool

Any idea how to adress items from a personal calender ?

niveauverleih said...

Let's say, your personal folder is called "MyOwnFolder" and the calendar in that folder is called "Calendar".

In my macro you need to find the line that says:

Set MyFolder = onNamespace.GetDefaultFolder(9).Items

and replace it by

Set MyFolder = onNamespace.Folders("MyOwnFolder").Folders("Calendar").Items.

I hope that works.

Nick

eshur said...

Mark,

Just the tool I am looking for, but how do I run the code without having VB?

Please help

niveauverleih said...

Hi Eshur,

If you have a Windows system (I don't know how or if Outlook provides VBA on MAC OS), you can access the VB Editor from Outlook via Tools/Macro/Visual Basic Editor or by pressing Alt and F11 simultaneously.
There you can paste the code.
For more detailed information, check here.

Anonymous said...

This is a great tool !

I'm just wondering if you would have any sample code demonstrating Category filtering.

niveauverleih said...

Hi,

I just posted a new version of the code, where you can define a list of categories to be excluded (at the beginning of the code). Just download the macro again.
This new version also handles appointments that stretch over more than one day.
Note that the macro automatically excludes zero-duration appointments, which are a good way to keep your calendar from being cluttered.

Kind regards,

Nick

Anonymous said...

Hi.

As a tip we've actually changed:

onNamespace.GetDefaultFolder(9).Items

to

onNamespace.PickFolder.Items

which allows someone with several Calendars is his/her folder tree to pick which one is used to generate the Year View.

Cheers.

Margriet said...

This tool is wonderful and so are the changes that were made last week!

I have two questions in case you will make further options and improvements to this macro:
1. would it be possible to make one where instead of days of the week, the actual dates (1,2,3 etc) are written in the lefthand column?
2. Would it be possible (at least in case of full day events), to color the day or appointment itself like in outlook?

Thanks for this tool!

Anonymous said...

I'd like to use as an work long-range planner and want to filter for only all-day events and for appointments with certain names in the subject line. Not sure how to accomplish. Help?

niveauverleih said...

1. For Margriet:
a) Having the "day of the month" as rows is now possible. You need to set "blAlignWeekDays = TRUE" (at the beginning of the script).
b) Coloring should be possible, I need to check.
2. For Anonymous:
Filtering out by keywords in the subject and leaving only all day events is definitely possible. I'll implement it as soon as I have time.

niveauverleih said...

For Margriet: events and appointments are now colored like in Outlook (business, personal, important, holiday etc.). All day events do not work correctly yet, I am working on it.

Margriet said...

This updated version shows indeed the days in the month the way I was looking for! Perfect.

For some reason I cannot get the colouring to work. Any ideas on how to resolve it?

niveauverleih said...

Margriet:
Please put an apostrophe before the line "on error resume next" in the Function GetColor(objAppt).
You will most probably get an error the next time you run the macro. What is the error message?

niveauverleih said...

I stumbled upon this today:

OL2000: How to Print Four Months of Your Calendar on One Page

Quite cumbersome, but works.

Anonymous said...

I think the weekends are wrongly coloured as Friday is coloured and not Sunday. Does this need a fix??

Anonymous said...

Have fixed Weekend colour prob with the following. Hope you don't mind

bgcolor = "#FFFFFF"
Select Case intRealWeekday
Case 7
bgcolor = wheat_light
Case 1
bgcolor = wheat_dark
End Select

niveauverleih said...

Thank you. I've corrected this.

Anonymous said...

Tjohooo!

Finaly someone who saved my ass.
The last changes have been most appriciated and useful. This VBA code runs like a warm knife in butter.
Thanx!!

A little code tip :
myitem.Location with the subject

And a suggestion :
Problems with time on my server. Probably norwegian date/time.
If i strip the time in restriction it works fine.

margriet said...

Still cannot get the colouring to work. I tried the apostroph before on error resume next, and got : runtime error '429' ActiveX component can't create object. When I tried to debug, it highlighted: Set objCDO = CreateObject("MAPI.Session")

Any suggestions how to resolve?

Another question about the layout: I tried to make a version where the numbers of the day are not printed in each cell to make it more suitable to print on A4. It was easy to remove them, but then each day starts with an empty cell. How to prevent that for days where there are appointments?

Thanks for your help!

Shonn said...

First let me say you are a great programmer and I appreciate you developing this. Second, how would I limit the calendar to a single category without exluding the entire list.

Thanks

Seb said...

very cool script thank you!!!

unfortunately, I need 2 tweakings which may be way beyond the current scope of this script and I haven't found them in any script or commercial product for Outlook. I can't believe a feature like this wasn't required until now.

All I need is a script that would send at 5 PM the calendars for the next day for all my colleagues in one email to everyone else:

NAME 1
appointments

NAME 2
appoitments

etc

This is for my colleagues and managers to see what's going on next day in the office and who's meeting/going where.

I would really appreciate any hint of how to start, like getting for example the shared calendars in VB...

Thanks!

Anonymous said...

This is a top bit of scripting indeed!!

one quick question? Can this be adapted to display week numbers as can be shown in outlook at all?

Perhaps another VbYesNo?

Cheers

ellenml said...

I really like the Yearly Calender View, but I was wondering if it is possible to list the days across the page, and the months as the row header?

Thank you. EML

Anonymous said...

wow -very useful, thanks so much for putting effort into this! good karma is flowing your way.

Anonymous said...

Hi! Great Job! We are looking for this very thing, but we would like an administrative assistant to be able to print it out for numerous staff. Is there a way for her to select it for various people.

OneMario said...
This comment has been removed by the author.
Eni said...

Very cool! Lots of thanks!
Recurring appointments don't display colors - Can you fix that?
E.

Loring said...

I like this tool, but I'm looking for something a little more basic in format, listing only the months (in blocks, like on a big desk or wall calendar) and within each block the events or appointments taking place by date.
Example

2008
JAN FEB MAR
1 New Year's Day 3 Super Bowl
2 Back to work
20 Job Interview

APR MAY JUN
5 Dad's Birthday


JUL AUG SEP
5 Wedding

OCT NOV DEC



Where each year is displayed on a full page.

Does this application exist?

ardi said...

hi thks for the script. really useful. one problem is with recurring appointments it shows them in the empty cells.
well done!

Ben Bloss said...

Great coding, thanks for sharing this.
Have an error though it doesn't show all my appointments, only ones from one month. I have a calendar with 3 months of all day appointments for a road trip I am going on telling me how long I am staying in each city and then travel days, but it only shows the last month of my travels.
Thanks

Bill said...

Hi Nick, like your tool. Is there any way to adjust or select the year? I need to work with 2009 items.

danijel said...

Great! I use the generated html with Excel to have better handling for printig. Thank you!

Anonymous said...

For Bill - I'm not sure if there is an easier way, but I was able to print 2009 by entering 13 as the starting month and 24 as the ending month.

tzirvelc said...

It works great. Thankful.

Steve said...

Hello Everyone

Forgive my lack of vba knowledge.

I have pasted the code into my outlook 2007 and when I try to run from outlook it says

Compile error:
Expected variable or procedure, not project

Anyone help me here please?

Thanks

Bryan said...

I was glad to see somebody tackled this glaring issue in MS Office, but every time I attempt to run the macro I get an error stating "Sub of Function not defined."

Any idea what to change?

niveauverleih said...

Bryan: I guess you didn't copy the whole code. There is a sub and a function that you must copy.

Anonymous said...

This is a great tool to use. Is there a way to pick multiple calendars? I want to see my personal calendar, a group calendar, and an organization calendar together in the view.

Thank You.

Peter said...

I'm not sure people are still checking this, but when I try to run the macro, I get the error:
Run-time error '-2147352567 (80020009)':
Type mismatch or the value "01.10.08 12:00 am" in the condition is not valid.

Any idea what is wrong? I'm in Finland if that's of any help.

Anonymous said...

Great!!

Excactly I was looking for.

thanks..,
loopy

Anonymous said...

sweet dude, very sweet!

Anonymous said...

I'm trying to run the macro with Otulook 2003 and it got stucked at command "f.Write Contents".
Any idea ????

andrew said...

Is there a way to have this display past dates? I tried entering "-10" as the start month (3/09 - 10 = 7/08)
and "3" for the end month to get July 2008 through March 2009 and I got an error.

josi said...

I love this calendar!!! But I cannot get the colors to work at all! Please help!

yuvrajpardeshi@yahoo.com said...

I am very glad. For the first time something from the net i copied and pasted and it worked well. i am so so so glad that my project is now gonna move forward. thanks Niveau Verleih for such a super duper scirpt. i believe you now that anything is scriptable.

****What we need is the desire ****

***** 5 stars for this code / article

wow gold said...

When the Wow Gold wolf finally found the wow gold cheap hole in the chimney he crawled cheap wow gold down and KERSPLASH right into that kettle of water and that was cheapest wow gold the end of his troubles with the big bad wolf.

game4power.
The next day the Buy Wow Goldlittle pig invited hisbuy gold wow mother over . She said "You see it is just as Cheapest wow goldI told you. The way to get along in the world is to do world of warcraft gold things as well as you can." Fortunately for that little pig, he buy cheap wow gold learned that lesson. And he just wow gold lived happily ever after!.

buy wow gold said...
This comment has been removed by a blog administrator.
Anonymous said...

Thanks very much! it worked in Outlook 2007/Vista config, but like "andrew", I'd like to know how to get prior months from a previous year, i.e., its now May 2009 and say I'd like to see a calendar from Sept 2008 to Oct 2009.

Anonymous said...

Very good job. I appreciate you sharing it. You are very talented.
-PL

bengali said...

Very cool stuff indeed. I have a challenging problem that I think scripting could easily solve, but I am not sure how. I have multiple Outlook calendars, each tracking different stuff. I want to create an Outlook calendar that keeps all appointments of a specific category (say, parties) from all the other calendars. So, it would be an integrated and updated calendar of specific categories. And I have no idea of how to do it. :) Want to take a stab at it?

Anonymous said...

Hallo
ich habe die Version 2.1 runtergeladen. Wechsle den Namen auf xxx.vbs. Mache den Doppelklick und erhalte direkt eine Fehlermeldung: Linie 1, Expected Char 1. Expected Statement.
Was mache ich ev. falsch? Ich gebe soweit auch keine Parameter ein. Es wäre toll, wenn du mir helfen könntest.
Danke!

niveauverleih said...

To download the script, left click on the link. Copy the contents of the window that opens into a text file. Save the text file as "Yearly Calendar.vbs"

Anonymous said...

Hallo Niveauverleih, danke für den Tip mit dem Filenamen. Er muss wirklich als Yearly Calendar.vbs gespeichert werden dann funktioniert es. Danach saugt das Programm die Daten runter zum Teil zum richtigen Datum zum Teil falsch mit +/- 2 Monaten Verzögerung. Z.B ein Termin vom 12. Oktober habe ich nun am 10. Dezember im Angebot. Was könnte dies sein? Ich habe noch kein Pattern rausgefunden. Falls notwendig schicke ich dir auch gerne mal die Auszüge.
Gruss
Andre

niveauverleih said...

Das pattern ist deutlich - das Programm vertauscht Monat und Tag. Das muss mit dem Unterschied zwischen amerikanischem und deutschem Datumsformat zu tun haben. Hilft das schon?

Anonymous said...

Hi
When i try to run this script i have this error: "Run-time error '-2147352567 (80020009)':
Type mismatch or the value "01.10.08 12:00 am" in the condition is not vali" ???
I use Outlook 2003 in French
Any Idea
Thanks for all

Mike said...

I am a Microsoft Outlook user. Few days ago, I got an error in outlook.
I was unable to open outlook. I tried Inbox repair tool to fix outlook file, but it could not help me. After that I contacted with Repair Outlook PST
file
. They are Outlook pst expert, they repaired my pst file.

Jon said...

Found your feed and implemented my very first VBA script. Thanx for a great tool and a great experience!

Alex said...

I have numerous issue with emails. But once I by chance sighted a tool - pst format viewer. It interested me funny design and something else. I haven't use this tool, but I am sure when I want it will help me easy. Moreover this software restores data from files with *.pst and *.ost extension.

Alex said...

For me outlook messages are very important. But some days ago I had a big problem. All my emails were lost. Luckily I found out - program recovery pst files, which my friend had advised me. It settled my issue for seconds and absolutely free of cost as I kept in mind. What is more I have been glad...

Alex said...

I know some interesting utilities for working with Outlook emails, but some of them I didn't use. One day I was working on my computer and the light was switched off. I lost all my working data for a second. I was upset, but kept my head and quickly found out a probably determination for my problem. I suppose this utility can help in this issue too - .ost converter.

gardeàvous said...

Thank you !! very useful and so easy for somebody who is not strong enough to do it myself !! Catherine

Anonymous said...

Many thanks !!!
so easy to use for somebody who doesn't know code at all !!!
Catherine

Anonymous said...

very cool indeed

Chris B said...

A few years on, and this is still a resource worth having - why Microsoft haven't picked up on this I don't know, but thanks for your efforts - greatly appreciated.

nick said...

153Great post, found were I was looking for ! +10