Creating Toolbar Buttons in OneNote 2007
As I mentioned on Monday you can create toolbar buttons in OneNote 2007. This enables some great scenarios such as:
- Checking in files or having them publish to another program
- Run your code instead to do something with the current page
- And more obviously
We allow you to create a toolbar button which is either an icon or text that will sit on one of the OneNote command bars. They can appear on the standard toolbar at the end of the menus or on any other toolbar. When the user clicks on the button we will CoCreate your code (since you implement an interface we make available) and we send you the current page that was sent. You can see that it looks like this:
Additionally you can have OneNote run your code whenever you run OneNote and we will send you events that you might be interested in. OneNote will send events for whenever the user changes some content on a page or whenever they navigate to another section/page, etc.
We really envision many cool toolbar buttons and addins; here are some things which are in the pipeline:
- Word Count – One of the testers on the team wrote an application which will give you the current word count of the page you are viewing.
- Sort Pages – I am writing an app which will sort all of your page tabs in alphabetical order (still one nasty bug with subpages that I need to fix).
- Web Export to SharePoint – Another PM on the team has written this great
app which will export the current notebook as a webpage and you can easily publish it to a SharePoint site!
So here are just 3 of the toolbar buttons that we have written and there are more in the pipeline but there are *plenty* of opportunities for you to write your own powertoys and applications. Such as:
- Integrating OneNote 2007 with a Document Management System such as SharePoint or maybe even something with Blackboard?
- Have something to blog the current page with Windows Live Writer?
- Whatever you imagine takes you to!
That being said I would like to give you all documentation on how to create your own toolbar addin. Note that this will not work unless you have B2TR and my directions are for use in C#. I will have to create another for C++ in the future (though I will have to dust off my C++ skills since I only use C# now). That being said this should help you get started right away with writing powertoys and applications
In the future I plan on releasing a sample project that you can download and I will also dissect a toolbar addin that I wrote to test one of the new API calls. Please give me feedback on this and let me know what you think, I believe this will be a good starting point for most people. Once B2TR comes out then you can try your code out!