Introducing OneNote DevPal
OneNote DevPal is an add-in for Microsoft OneNote 2007 targeted at developers interested in OneNote extensibility. My goal was twofold: provide a source code example of how to create a OneNote add-in for developers just starting out, and then provide the tool itself that will aid in any OneNote integration development.
The add-in was created by following the very helpful guide provided by Dan Escapa. I would advise anyone just starting out to read that first.
The add-in itself is an equivalent to the "view source" function of a web browser. It allows you to inspect the XML that corresponds with the page you are currently viewing in OneNote. After installing the add-in, you will have a "DevPal" button on your OneNote toolbar. When you click the button, the OneNote DevPal window will open and display useful information related to the current page. If you navigate to a different page in OneNote, DevPal will automatically update to reflect the current page (after a slight delay). If you are integrating with OneNote and don't know their XML schema off the top of your head, you will quickly realize how helpful this tool is. For example, if you want to know how a bulleted list in OneNote is represented in XML, just create a bulleted list in a OneNote page, and then click the DevPal button to view the XML source.
Alternately, you can view the XML representation of your OneNote hierarchy. This is very useful if you want to programmatically add new pages, sections or notebooks using the UpdateHierarchy API method.
- Display the contents of the current page, in XML form. Changing the page in OneNote will auto-update the XML in DevPal. It does not yet auto-refresh the current page if you make changes in OneNote, but you can get the same effect by navigating away, and then back to your original page.
- Display the current hierarchy in XML form. Changing the current page in OneNote will auto-scroll the hierarchy XML so that the current node is displayed at the top.
- Both XML displays are syntax highlighted specifically for OneNote XML (OneNote start tags, "ID" and "name" attributes, and CDATA text are emphasized)
- Displays the level, name, and object ID for the current page, and each of its parent containers, all the way up (Page, Section, SectionGroup, Notebook)
- Records all events raised by OneNote to the standard debug output. By running a tool like DebugView while using OneNote with DevPal, you can better understand what and when events get raised by the add-in API.
If you are doing any OneNote integration, the following links will be helpful: