I was reading the newsgroups again the other night and "SubSeaGuy" made this post:
"I want to create a custom calendar. Rather than typing in the date on each page of which there would be 365, is there a way to import the page name. The example would be to create the dates (day, dd-mon-yyyy) in say excel, and then import that data as page names."
Time for a new Powertoy! I've been itching to write another (where does the time go?), and this looked like a great reason. I started with my text importer, stripped out the stuff I did not need and added in a routine to account for the dates to use as page titles. Here's what it looks like on a Windows XP computer:
It was pretty simple. It let you pick a start date and a number of days to create. For instance, it looks like SubSeaGuy would want to start on January 1, 2009 and go for 365 days. You can control the date format the page title will get as well. A long format looks like this:
Monday, October 06, 2008
And the short format would be
These settings can be changed in the Windows Control Panel \ Regional Settings application if you want.
I added the agenda settings after the first iteration. More on that process later. For now, just select whether you want an agenda view, the start and stop times for it and the time increment.
After making these choices, choose the notebook and section where you want the pages created and press "Make Calendar." Since the pages are blank, it runs pretty quick. On my trusty HP, it took 18 seconds to make a year's worth of pages. Not too shabby, I think.
I liked this application for a couple of reasons. One, it let me reuse some of my code, so it was pretty easy to write :). Two, it spawned some great ideas for features and test cases. For instance, I did not know whether to let you choose how many days worth of pages to create, or use two date pickers to let you set a start and end date. I decided on the simple number of days since it is a little easier to test, and has a little less code to write.
I hope you get some use out of this. I can see it being used to save a little time here and there.
And there is no setup for this. Just copy the file (link below), unzip it and rename it to .EXE and start it. Remember, you will need the .NET framework and OneNote must have the .NET programmability component installed. To check it, look in Control Panel | Programs (or Add/Remove Programs), change the Office install, and look under the OneNote tree to see that the component is installed:
You can get the source code here: OneNote Calendar Source Code
Update 8-4-2010: new link for source code is http://johnguin.web.officelive.com/Documents/oncalendar.zip
The link for the powertoy is below.
Let me know what you think!
Question, comments, concerns and criticisms always welcome,