Table Sorting and Table of Contents powertoy for OneNote 2010

Nani, who created the original Table of Contents powertoy for OneNote 2007 expanded her code to add the ability to sort tables.


Here's her description, and you can get the download file by [updated as of 4-28-2011] going here: looking under my signature at the end of this article.



This power toy allows users to:

  • Create a new table of contents page outlining the pages in the current section. The feature can be accessed through the ribbon:

Insert -> Table of Contents -> (Outline | Last Modified Date)


This mirrors the functionality of the original OneNote 2007 addin.


  • Sort on OneNote tables:

If a table is selected, it can be sorted on the selected column. User has the option to exclude the first row. The feature can be accessed through the ribbon:

Select a table, Table Tools -> Layout -> Sort Table



So the "Ignore First Row Asc" will sort the table using the selected column but leave the top row unchanged. This way, if you have something like this


if you sort by the first column.

Other Improvements from OneNote 2007 version:

  • Page level improvements:

With the 'Outline' table of contents, you see sub-pages indented based on page level

  • Performance has been dramatically improved
    • Instead of getting the hierarchy for all opened Notebooks (twice), the CurrentSectionId property of the new Window class is used to get the hierarchy for the section
    • Improved sort function when creating sorted table
    • Improved efficiency in creating the table xml



  • If you add data to the same outline as the table of content, the added data will be lost on TOC update. Data in other outlines will be maintained.


There are 2 setup files included at this page: One is for the 32 bit version of OneNote (the "x86" setup), the other is for the 64 bit version. You can click File | Help in OneNote and see which version you have over on the right. Exit OneNote completely before running setup!


Enjoy this great powertoy! I'll get the source code and package it up as well. Since I can only have one attachment per entry, it will have to wait.

Questions, comments, concerns and criticisms always welcome,

Comments (44)

  1. JohnGuin says:

    There is, as of 10-22-2010, a typo in the batch file for the x64 version, and setup fails.  

    To fix it, install, then go to the folder where you installed it.  There will be a file there named "Tocx64reg.bat"

    Edit it, and change the text to this:

    cd C:WindowsMicrosoft.NETFramework64v2.0.50727

    regasm "C:Program FilesMicrosoftOneNote Table of ContentsONTOCSort.dll"

    The typo is the path in the regasm command needs to be changed to "Microsoft" rather than just "MS"

    I hope to get this fixed ASAP.

    Sorry for the problems,


  2. cc0 says:

    I like the idea of this, but the sort does not work correctly when using pairs of letters. For example I try to sort these three values;




    It returns;





    And many others… something is wrong with the sorting algorithm. It does not even work with paired numbers. I'd love it if you could get around to fixing this, it would be a really useful tool for me and I'm sure many others.

  3. JohnGuin says:

    Hmm.  Let me look into this – the powertoy simply uses the .Sort method of the control, so this may be a problem with that control.  And just to be sure I completely understand your table, can you contact me via my email link at the upper right so I can get a copy of the table you are using?  Using the values you give above in a table, I get correct sorting.

  4. Brandon says:

    Is the source code for this forthcoming? I would like to modify to generate a TOC for the entire notebook. This 'Outline" function of this plugin essentially duplicates the functionality of the page pane. What is really needed is that gives a global display of all the content in the Notebook.   Right now I have to go through each section by hand, run the outline, and compile the results. Something automatic would be very useful.

  5. Brandon says:

    I guess I just needed to read your next blog post!

  6. Kris says:

    The addin is really great, but I would really want to have an extended functionality for this:

    The idea is great, but as onenote 2010 provides the possibility to assign titles within a page and even different levels of titles, it would be great if it was possible to have a table of contents for the inner structure of a page. Basically, the same feature as existent for word but for some weird reason not included in onenote.


  7. Just wanted to say: SUPER! says:

    Wow, this is perfect. Thanks for sharing.  Have been struggling for a year until I found this!

  8. Stefan says:

    I tried to install the table sorting powertoy on OneNote 2010 64 bit.

    I changed the bat file.  However, OneNote 2010 gives a runtime error.  Any suggestions?

  9. John says:

    Can you send me an email from the link at the upper right?  I have a file I want to send you.

  10. Adrian says:

    This may be a stupid question, but would this work with OneNote 2007? I love the 2007 TOC add-in but would like to sort my TOC by page name. Seems that this plug-in would give me the ability to do that (albeit manually) and also give me general table sorting too.

  11. John says:

    No, the table sorting only works with ON 2010.  Might be a good learning project for someone to backport…

  12. farid says:

    sort table works, just little bit slow, but i rather slow then not having the function, so to the developer, good job. thanks!

  13. On x64 ,changed the bat file,but no addin visible…………

  14. Scratch my last comment  ; i have win 64 but Office 32 bit , so naturally it didn't work !

    I installed the right version and it works fine.

  15. kneghx says:

    I'm running W7-64bit with Office 64bit, I altered the .bat file but the addin still won't show up.

  16. JohnGuin says:

    I updated the files recently – can you download and try again?

  17. This is smashing! Nani, John, thanks a lot! BTW you don't know of any way to insert a TOC for an individual page, do you? In Word you can insert a TOC that shows all the headings. Maybe I just need to get the hang of outlines.

  18. John says:

    OneNote does not have the table of contents functionality of Word.  If you want, you could explore Tagging the lines that you want to use in the table, then using the Find Tags to create the "table of contents" with links to the tagged text.  Then you can copy the links from the summary page and use it for your ToC.

  19. kneghx says:

    I downloaded it and reinstalled TOC today. No change, still doesn't show up in OneNote.

  20. sfb says:

    I just upgraded to OneNote 2010 and would like to try this PowerToy. However, when I try to install it, it claims that it's already installed. Does this PowerToy conflict with others? Thanks!

    – sfb

  21. JohnGuin says:

    sfb – which other addins do you have installed?

    kneghx – are you installing as an admin?

  22. kneghx says:

    I was installing while logged in as an admin but I wasn't hitting Run As Administrator when I ran setup. But I just tried it now and still no luck.

  23. John says:

    2 last things to check.  In File | Help and over on the right, what version of OneNote do you have (14.0.4760.1000 or something similar to that, and is it 32 bit or 64 bit).  Also, does it say "Click to Run" anywhere?

  24. sfb says:

    My last comment didn't seem to get posted. Let me try again. The add-ins I've installed are Page Tabs, Template Manager, Word Counter, and Sort Sections (which OneNote claims is Legacy, though it's the 2010 version).

    Thank you!

  25. kneghx says:

    I'm running OneNote Version: 14.0.4760.1000 (64-bit)

  26. Nicholas says:

    I cannot get this to work on Win 7, Outlook 2010 32bit.  I install, ran as administrator, and Onenote hangs.  I have to go in to task manager to cancel windows.  When I reboot Onenote it says that the add in is causing problems.  Only if I hit disable, will Onenote work again.  I have tried reinstalling/removing/repairing multiple times and it does not work.  I have tried this on a different computer (same setup) and the problem is the same.  

  27. John says:

    Can you triple check to make sure you are running setup.exe from the 32 bit setup folder?  And do you have any other addins installed?  Last thing – do you have a click to run version of OneNote installed (easy check is to see if there is a Q: drive on your computer)?  Sorry for the problems.

  28. Nicholas says:

    I checked again.  I am running the 32 bit setup, windows is 32 bit, and OneNote is part of a dowload edition of 2010 (i.e. not a run version).  Just hangs every time.  

  29. JohnGuin says:

    Here's what I would do:

    1. uninstall any ON addins I have

    2. reboot

    3. try the ToC addin by itself

    4. add the others back to see which ones are conflicting

    5. If none of this works, I'd repair the .net framework (but at this point I'm grasping at straws).  

    Let me know if none of this helps.

  30. Nicholas says:

    Uninstall, reboot, reinstall worked!

    (BTW, I had no other plugins, so I skipped that step).

  31. Nick says:


    Great tool – just one comment, if there is more than one table on a page I get an error when i try to sort (using any of the 4 options). Is this a known limitation and if so, are there plans to resolve/ is this possible?

    The current workaround seems to move the table to a new page, sort and then move back.



  32. JohnGuin says:

    No plans to update this – I just want to set expectations.  If anyone downloads the code and fixes this, I will be sure to post an update, though.

  33. Jessamyn says:

    I just installed the 64-bit version but I also can't get the add-on to appear in the ribbon.

  34. Aaron says:

    Here is what I get, OneNote 2010, 32bit: (I used the great onenote feature of screen captrue + copyu text from picture, so this isn't the exact text, but very close)

    Assertion Failed: Abor

    t=1J uity=Debug Ignore=Continu,1f fl

    at ConnecL Q nDonrwton(O bject application. exLConnectM ode connectM ode, Object addl nlnst, Array& custom)

    Abort Retry Ignore

  35. John says:

    Can you use the email me link in the upper right?  I want to get a copy of the table that may be causing this.  Also, have you run windows update recently to ensure you have all recommended patches?

  36. Rand says:

    I've just installed the ToC tool and now when I try to shift to the Table Tools, I get this error dialog:

    Assertion Failed: Abort=Quit… (title of dialog)

    at Connect.OnConnection(Object application, ext_ConnectMode connectMode, Array&custon)

    Any idea what's going on? When I restart OneNote I'm asked to disable the ToC add-in.

  37. JohnGuin says:

    Can you look in File | Help and see what version of ON you have, and whether it is 32 or 64 bit?

    And what version of the .net framework you have (Control Panel | Programs and Features should list it here).

    Sorry for the problems.

  38. John Schmidt says:

    After upgrading the computer to Windows 8 Pro, the Alpha Sort does not work.  How do I fix this?

  39. JohnGuin says:

    Did you reinstall the addin?  Or take any other troubleshooting steps?

  40. Ari M says:

    Tried installing TOC_2 on a system running OneNote 32bit on a Windows 8, 64 laptop. I get the message that a previous version is installed. However, there are no entries for TOC in the Add/Remove programs panel.  Installed and uninstalled version 1 (2007), but still get the message. Any suggestions?

  41. John says:

    Ari – do you have any other addins installed?

  42. Ari M says:

    Just discovered that my earlier reply to you didn't post. Sorry.

    Active add-ins: OneTastic;

    Inactive: MS Mathematics Addin, Page Tabs, Printout Manager.

    Legacy add-in: OneNote Sort Pages 2007

    I will possibly update to Office 2013 this week. Will this issue carry over, or is a possible solution of academic interest only?

  43. Evoco says:

    This would be great if you have an update for office 2013 / OneNote 2013!

    I will show this week if you have any updates.

  44. John says:

    Ari, OneNote 2013 has the table sorting built in and I have no plans to update this addin.  IIRC, the person that wrote this had a conflict with a GUID from the sort pages addin, so removing that one may help – but I may be wrong on this.

Skip to main content