Reference: Ccreating Toolbar Buttons in OneNote 2007,
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:
Download sample code from OneNote Web Exporter http://www.codeplex.com/ONWebber. The solution contains
- a C# console application project called "cwebber".
- a C# class library project called "Webber".
- a setup project called "Webber Setup".
- Build Webber Setup and run the .msi to setup the add in
- At the beginning of the OnClick event of the add-in (found in Program.cs), put a MessageBox in order to suspend the process when the event has fired, given us enough time to attach the debugger.
- In OneNote, click on the add-in icon. The message box will be displayed.
- With the MessageBox displayed, go to visual studio, open the Webber solution, choose Debug->Attach to Process and select dllhost.exe (aka COM surrogate), which is the process responsible for handling the add-in's DLL
- Breakpoints will now be hit.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.