Freigeben über


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:

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

Creating a Toolbar Addin for OneNote 2007 (DRAFT) (PDF)

Creating a Toolbar Addin for OneNote 2007 (DRAFT) (XPS)

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!

Comments

  • Anonymous
    September 07, 2006
    Can't wait to get a copy of TR so I can give this a try!

  • Anonymous
    November 30, 2006
    I just created a test project based on your toolbar creation PDF using the RTM version of Office 2007.   It builds fine as long as I don't click on the 'Register for COM interop' button in the project properties.  If I click that, I get this error: The assembly "C:Usersgrosch.AMRDocumentsVisual Studio 2005ProjectsOne NoteShowOneNoteXMLAddinShowOneNoteXMLAddinbinDebugShowOneNoteXMLAddin.dll" could not be converted to a type library. Type library exporter encountered an error while processing 'ShowOneNoteXMLAddin.Class1, ShowOneNoteXMLAddin'. Error: Element not found. Are there any changes for the RTM version?  I'm guessing we don't need the OneNoteAddin.cs class file any longer as the IOneNoteAddIn interface is already published (though I tried both with and without it to resolve the above error)

  • Anonymous
    November 30, 2006
    Ignore that last comment.  I had specified the project's GUID on the class instead of a unique GUID, which is what caused the problem.

  • Anonymous
    November 30, 2006
    Great glad to hear!

  • Anonymous
    December 02, 2006
    The comment has been removed

  • Anonymous
    January 16, 2007
    I just got an email last week from Michael at Mindjet where he wrote me about a new app he wrote that

  • Anonymous
    February 06, 2007
    I couldn't get the example posted in the write up to work.  I needed a working example, that provided me with something to look at.  The problem was I was missing the {} in my installer. http://feeds.feedburner.com/joshuaflanagan (RSS feed) provide a great one with is quite handy to boot.

  • Anonymous
    July 02, 2007
    The comment has been removed

  • Anonymous
    July 08, 2007
    The sample code and setup instructions helped me add a button on the toolbar. I'll like to associate an icon with the button. How can I achieve this? What should be the registry settings to get this working?

  • Anonymous
    July 10, 2007
    There is a IconPath value in the registry that points this out.  It is all in the documentation.

  • Anonymous
    August 09, 2007
    I have added add-in in toolbar by following same instruction as mentioned in the document. I'll like to  add another button on the toolbar, i followed the same instructions for registry for adding second button into toolbar but after running setup i couldn't find second button, i can see only one button in my toolbar. What should I do to get this working?

  • Anonymous
    August 13, 2007
    Ravi - Make sure that you register the second button in the registry.  For each button there will be a new path until the Addin key in the registry.  Make sense?  Install a few of the powertoys from my blog and John's blog and then look in the registry to get an idea of how this works.

  • Anonymous
    September 03, 2007
    http://msdn2.microsoft.com/en-us/library/aa286798.aspx - Section OneNote Add-ins and Toolbar Buttons talks about facilitating the developer with an option to specify whether OneNote launches custom code when it starts or when a user clicks a button in the UI. I'll like to know how we can launch the custom code when OneNote is launched? In the business scenario that I have, I need to monitor a set of OneNote files stored in a specific folder on the file - system  to track the attachments added to the files. I plan to do this using the FileSystemWatcher and OneNote API. I do not want to write a windows service for the same since the scope of the FileSystemWatcher is restricted to the OneNote application domain. Any suggestions on how I can achieve the same?

  • Anonymous
    October 09, 2007
    I had followed all the steaps whtever mention the above document, but still the custom button is not displayed on the onenote toolbar

  • Anonymous
    October 10, 2007
    I had followed all the steaps whtever mention the above document, but still the custom button is not displayed on the onenote toolbar.what may be the problem

  • Anonymous
    December 20, 2007
    Gary Neitzke took a few minutes to create a draft of how to create a "floating toolbar" with your addins

  • Anonymous
    December 20, 2007
    Gary Neitzke took a few minutes to create a draft of how to create a "floating toolbar" with

  • Anonymous
    December 31, 2007
    PingBack from http://restaurants.247blogging.info/?p=1163

  • Anonymous
    January 20, 2008
    Can anybody please tell me wat does "YOUR GUID" mean...

  • Anonymous
    March 29, 2008
    Dan, Is there a way to add custom category icons in OneNote 2007? ON's default categories are primarily business oriented. However I, like many other ON users, use OneNote strictly for personal use at home and on the road. I have categories setup currently for things like: Medical, Family, Vacation, etc.  But I had to use existing categories, rename them, but keep the existing icons, which certainly don't match the current categories. Any chance of finding out how and where to add additional category icons? Thanks! Jim

  • Anonymous
    May 18, 2008
    The Links to PDF and XPS files (http://elhombre.members.winisp.net/api/How%20to%20Create%20a%20OneNote%20Toolbar%20Addin.pdf ) don't work. Can you please check

  • Anonymous
    February 17, 2009
    I customized my own toolbar in One Note, but the next time I opened up the program it was gone. How do I SAVE the customized toolbar for next time?

  • Anonymous
    April 15, 2009
    Hi, I read the OneNote Toolbar Add In document and was trying it out on my Vista laptop. Everything worked fine until I uninstalled the dll thru Add Remove Programs. Now my laptop is all messed up. None of my shortcuts work from the start menu – I have to go to where the application is installed in the C:Program Files to launch – like Outlook. Some of the applications I had installed no longer work at all, saying that I am missing some files, however the file is there. I suspect that something got messed up in the registry, however I followed the instructions exactly, and everything looked really straight forward in the instructions. Any help you could provide would be greatly appreciated. Thanks, Julie

  • Anonymous
    June 29, 2010
    Hi! Are there any infos available to create an addin for the ribbon in onenote 2010? Thanks

  • Anonymous
    April 04, 2011
    Sir can u provide more information on how to create addin in c++,pls its urgent.thnaks in advance.