Friday, 26 December 2008

Outlook based multi-month calendar v2

The following script is version 2 of a macro that I have published in an earlier article.

Yearly Calendar version 2

What it does:
It displays all your Outlook appointments (longer than 0 minutes) for a number of months (you choose which) on one page.

What is new?
1) It is now a vbs script and no longer a Macro. Scripts are easier to run than macros - just double click the file "Yearly Calendar v2.vbs" (after downloading, rename the "Yearly Calendar v2.txt" file into "Yearly Calendar v2.vbs" first).
2) There are 3 output formats now (instead of one):
- one month per row
- one month per column
- 7 columns (Monday through Friday)
3) The restitution of Outlook appointment label colors is improved. They now also work for the non default calendars.

For the other features please refer to my previous article.

30 comments:

norm said...

This is just what I’m after..... I am new to all this and can’t get it to work. Is there a step by step guide I can use......?

Pieter Van Gorp said...

Hi, thanks for the update. For some reason, the macro didn't work anymore after an office update...

I did notice a problem with your code: I want to run it against a calendar that relies on recurring events. Unfortunately, your script only creates one output field per calendar event whereas it should create a field per recurring event occurrence... Could you please fix this and post an update? I would be even more grateful than I am already.

Sincerely,
Pieter Van Gorp

Carlos Galvan said...

Cool Tool !!

Got the macro to work! Awesome!

Where should the Yearly Calendar v2.vbs file be placed to work?

many Thanks

Pieter Van Gorp said...

Hi Carlos,
> Where should the Yearly Calendar v2.vbs
> file be placed to work?

You can place it anywhere you like. You run it by double-clicking the file or calling it from the command-line or another shell script (as opposed to the macro solution, which is run from within Outlook).

Any comments from the script author with regards to my previous comment on recurring events?

Regards,
Pieter

niveauverleih said...

Pieter: I checked and realized that recurring events DID appear, however only at the end of the list, after all non recurring events of the same day. I added a sort command and now it should be fixed.

Pieter Van Gorp said...

Still doesn't work for me... Please contact me and I will send you the ICS file for testing. In fact, you can just grab the public google calendar without contacting me personally.

Thanks for the debugging,
Pieter

george said...

Awesome tool. Works great except for one error - "Could not create the MAPI session to retrieve appointment cloors. Will continue without colors."
All data comes up just great.
Just love the ability to select the number of months.
Now to see if I can modify the script to enlarge row and/or column widths..
Thanks for all the work you put in...george

Anonymous said...

Got a windows scripting host error on line 533: Type missmatch UBound

Looks like the array "arrBinary" is empty...

Anonymous said...

Also got a windows scripting host error on line 533: Type missmatch UBound

Galorin said...

Looks promising, although I am getting the same errors as the others, arrBinary is not behaving as expected.

However, my errors are are on line 534 : For i = 0 To UBound(arrBinary)

It's returning a type mismatch, which means either arrBinary is emty, not initialised, or contains junk data. Seems to be a problem created by Windows Update as opposed to your own code. I don't have time to do a solution, plus I'm no good at VBS.

Victor said...

Hey Nick,

I found your name while searching the WWW and saw the Outlook VBA code. What, if anything, can be done to find a shared calendar?

Victor

semtex007 said...

I am also receiving the error message:-
on line 534 : For i = 0 To UBound(arrBinary)

Any clues, please?

Lausta said...

Not sure if this is still up and going, but I tried the link to your 2nd version and it doesn't seem to want to load for me. Thoughts?

Anonymous said...

It really works great. Unfortunately it is only passive display, but i still wonder why this is not in outlook...

Anonymous said...

i COULND'T GET IT TO RUN WITHER -- GOT THE MESSAGE "Could not create mapi session to retrieve appointment colors. Will continue without colors", and then nothing happened. Is there a fix? Thanks.

Jörg said...

Ein Super Programm-Danke für die Arbeit
Leider erhalte ich folgende Fehlermeldung: Could not create Mapi session to retrieve appointment color
Was muß ich verändern?

Anonymous said...

For those who have the "type mismatch" error (Ubound...)

Just add the following statement in the VBA script:
arrBinary = Array(1, 0)
under
'msgbox MainKeyPath

The result should look like this:

'msgbox MainKeyPath
arrBinary = Array(1, 0)
For i = 0 To UBound(arrBinary)
KeyValue = KeyValue & Chr(arrBinary(i))
Next

It worked for me using Vista and Outlook SP3 2003.
Regards from Germany
Mounir M.

Anonymous said...

Thanks so much, you're AWESOME.

I needed this and couldn't have done it myself - so glad you've made it available to everyone.

Perth Home said...

I followed the instructions by downloading and renaming as vbs. when i double click it just opens up the code in a browser.

Manolo said...

I am getting a

Type mismatch or the value "2009/07/01 12:00 am" in the condition is not valid.

Error in line 290 char 21

Running with an english VISTA and outlook 2003 but regional settings for Spain. Any suggestions?

diamondheart said...

Great job.. many thanks.. mad props and all that..

The previous version worked great. V2 however, throws this Windows Script Host error:

Line: 613
Char: 2
Error: 0x80041002
Code: 80041002
Source: (null)

Line 613 reads:

Set oRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}//" & sComputer & "/root/default:StdRegProv")

anyone have any suggestions or ideas? would love to get the new one to work..

dns said...

Hi NiveauVerleih,

How do i change this script so that it can display multiple calendar?

Kind regards,

dns

Anonymous said...

GetColor Function do not generate the right color in the webpage.

Do anyone know how to fix this?

Many thanks...

Anonymous said...

Hi All,

The HTML output file is in English. How do i change the output for my own language?

Pls....anyone?

arjen said...
This post has been removed by the author.
arjen said...

great script !!!!

I use vista & office2007 and I installed CDO. although the script says

Myfolder.IncludeRecurrences = True

to make recurrent appointments visible with me only the first appointment appears

I know that with XP & office 2003 all recurrent appointments appear with exactly the same script?

Can anyone tell how to change the code so all appointments appear?

arjen said...

it is always nice when you can solve your own problems
and the disadvantage of VBA-problems for me is that they stay in my mind until they are solved!

i read the change that was made for the problem from pieter van gorp ( see the comments aboves). i think the line

MyFolder.Sort "[Start]" was added
by NiveauVerleih to fix pieters problem

I now removed that line again and
:-) now everything works perfect
on my pc !
all appointments are visible !!!

Zee said...

Can someone advise me on getting the yearly view calendar to function in Outlook 2000? I have downloaded the file and clicking on the link brings up the script in my browser. how do I get the yearly view calendar to show up?

btw: what is the "injection_graph_func" file all about?
Thanks...

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"

Colin said...

Works great but throws up the error
"Could not create mapi session to retrieve appointment colors. Will continue without colors"
Any ideas ??