Updating the Page Sorter powertoy for OneNote 2010

Way back in 2007, Dan Escapa wrote a powertoy to alphabetize pages. He was good enough to send me the source code and after thinking about this for awhile, I finally figured out a way to get it update for OneNote 2010. Here it is (link is below my signature): enjoy! Eagle eyed readers might have spotted a hint for this update in my previous post

Once you install it, you will get a Sort Pages command on the Addins tab:


It will turn this (the pages on the left) into this (the pages on the right):


Notice the multiple levels of pages – that was the big stumbling block for me. I never could get my mind around a good way to sort these, and finally decided on the algorithm of sorting the parents first, then the children pages. It seemed to make the most sense overall.

And if you sort pages and then immediately decide you do not like the new ordering, you can hit CTRL+Z to undo the changes. Let me know if you think this is useful.

Questions, comments, concerns and criticisms always welcome,

Sort Pages.zip

Comments (67)

  1. Aaron Palumbo says:

    Thanks John I've been missing this one, very useful!

  2. Greg T says:

    I did the download and install and have the Add-In my my 2010 Onenote.  I have multiple notebooks opened and converted to 2010 format.

    On my first attempt, I selected the Add-in and my pages did not sort.  On every attempt after, the "Sort Pages" command is grayed out and mousing over does not make the button appear and does not respond.  When I exit and restart One Note (WIN-Shft-N), the Sort Pages command is responsive for just one attempt but it does not sort and grays out again.

    Do I need another something else loaded to support it?

  3. Greg T says:

    Additional information to my previous comment.  I just checked the Trust Center and none of the options for Add-Ins are enabled.

    In OneNote options -> AddIns, I have one lagacy add-ins:

    OneNote 2007 Sort Pages.

    I just recently installed OneNote 2010 and copied my OneNote notebooks from another machine and only installed the one Add-In found on here as "Sort Pages.zip".  Did I get the wrong add-in?

  4. JohnGuin says:

    This is the correct addin for OneNote 2010.  Try this: uninstall the sort pages addin.  Then restart your computer, then reinstall.  Make sure you run the setup.exe and not the setupproject.msi

  5. Greg T says:

    No difference when uninstalling – rebooting – reinstall.  OS = Windows 7 Enterprise 23-bit, in a domain environment.  In my Control Panel -> "Uninstall or change a program" displays "OneNote 2010 Sort Pages"

    In OneNote -> Options -> Add-Ins I have:

    – No Active Application Add-ins

    – No Inactive Applciations Add-ins

    – No Disabled Applciation Add-ins

    Installed OneNote legacy add-ins:

       "OneNote 2007 Sort Pages" (cosmetic error?)

    This is avery new install with very little customization (sans of what our GPOs do).  I do have .NET Framework 4 Client Profile and .NET Framework 4 Extended.

  6. John says:

    Yes, the 2007 name is left over from the conversion.  Are you an administrator running setup.exe as an admin?

  7. Aaron says:

    Do you have a sort feature for Sections?

  8. doug carmichael says:

    what a relief to have this. keeping the toys updated for 2010 seems just smart business for MS.



  9. Diane says:

    Is there any way to sort pages in ascending or descending order?  This way I can sort by the most current first (if I name my page appropriately) or is there another toy that allows for placing the newest page, highest on the list?

  10. Jan Roelof says:

    Diane: I wrote a sorting utility that can do what you want: sort ascending/descending and sort by name or last-modified-date. You can download it here: http://www.onenotepowertoys.com/…/OneNote2010SortSetup.zip

    Hope this helps!

    Jan Roelof

  11. John says:

    And the Table Sorting and Table of Contents powertoy may help as well: blogs.msdn.com/…/table-sorting-and-table-of-contents-powertoy-for-onenote-2010.aspx

  12. kcannon says:

    Thank you for such a valuable and useful tool!

  13. Chuck S says:

    Brilliant, thank you! And thanks to Dan Escapa for the original addin. Did you add the undo feature? That's nice, that wasn't there before.

  14. JohnGuin says:

    <blush> thanks.  Undo should have worked in the first iteration – I did not try to see why it was not working before.  Glad it works now!

  15. Marcus says:

    This is a great tool.  Thanks!  I noticed that when you sort pages with a number title, it only references the first number when sorting and doesn't consider the entire value.  So if I have a list with 1, 2, 3, 6, 21, and 57 and then sort I get the following: 1, 2, 21, 3, 57, 6.  Any workaround for this?

  16. JohnGuin says:

    that's a (strange) limitation of the Sort method.  It does not differentiate between digits and letters, so strictly dollows the "nothing before something" rule of sorting.  I think of it as 'a' comes before "aa", so it sort of makes sense.  But only from a narrow, computer science point of view.

    The only workaround would be to come up with a new sort routine and code the addin to use it.

  17. Marcus says:

    Alright.  I will play around and see if I can get something to work.  Thanks for the quick response.  

  18. Mark Jordan says:

    Any chance that you could release the Visual Studio solution and source code? I'd like to see if i could create an addition plugin to coexist with your in my environment, except that the sorting would be by creation date of the pages. Sometimes I like to sort by title, and other times I like to sort by creation date, depending on the notebook/context.

  19. John says:

    Let me dig around and see where the code is – this was actually written by Dan Escapa and I may need a some time to locate the location we had the code.

  20. Jan Roelof says:

    Mark: I point once again to http://www.onenotepowertoys.com/…/OneNote2010SortSetup.zip. This powertoy will sort sections and pages, by name or last-modified date, and if you wish recursively over section groups and pages with subpages.

    Hope this helps.

  21. mark jordan says:

    @janRoelof: I am aware of that tool. However, what I really need is a sort based on creation date. Thank you for your suggestion.

  22. AirForceBob says:

    Works greate except for one thing. When I try to sort he pages in my "Unfiled Notes" I get an error stating "Could not UpdateHierachy from OneNote: error code: Exception from HRESULT:0x8004200B"

  23. Sandra says:

    John, thank you very much for providing this add-in. Just what I needed.

  24. Fabrice says:

    Is there a way to "integrate" the OneNoteSort.exe behavior directly in the OneNote UI instead of having a separate exec?

    Thanks very much

  25. JohnGuin says:

    Fabrice – not sure what you mean.  OneNoteM.exe is the little utility that launches OneNote if you create a screen clipping or print to OneNote.  It's pretty small (a few hundred K) compared to many MB for OneNote.  If you want OneNote running always, you can add it to your startup group.

  26. Matthew says:

    Is it possible to sort by the date and time at the top of the page (the one at the top of the page that can be changed, not the last modified date)?

  27. John says:

    Seems possible – the code is at blogs.msdn.com/…/looking-at-the-code-for-the-sort-pages-powertoy.aspx if you want to make that change.  If you do, let me know and I can post your update here!

  28. Lisa says:

    I'm loving this page sorting!  I loved it so much that I installed the Section sorting as well, but it appears that the Section sorting has overwritten the Page sorting in the Add-ins.  Can they both play in the same sandbox?

  29. JohnGuin says:

    Lisa – no, they use the same id.  Sorry for the bad news,


  30. Desmond says:

    Thanks so much!

  31. Matthew says:

    Gem for OneNote (http://officeaddin.weebly.com/) allows users to sort pages alphabetically or by page time, and can also sort sections.

  32. John says:

    Pretty slick – I like how the ribbon is set up.

  33. Hormuzd says:

    Thanks heaps. Made OneNote that little bit more appealing.

  34. GB says:

    You rock!

  35. cdpeck says:

    I just started using OneNote 2010, downloaded and installed this in 5 seconds, and it works perfectly.  My compliments to the chef.

  36. pouya says:

    does it work only for English written text?

  37. pouya says:

    a duplicate page remover option is also a must have feature i don't know why OneNote lacks these essential and basic features always make it's users angry

  38. sfled says:

    Well done, sir!

  39. jet says:

    John – is the Sort Pages source code subject to a license of any kind (MIT, BSD, etc.)?

  40. John says:

    Just the general terms of use for sample code on MSDN:  msdn.microsoft.com/…/cc300389.aspx  The license information is at the bottom.

  41. Ian says:

    It seems that this loses the ability to link to Outlook. I used to highlight a task and link to outlook tasks – can't do it since installing add-in. Ideas?

  42. John says:

    This does not affect Outlook interop – can you repair Office and try again?  

  43. Steven Buehler says:

    Update for OneNote 2013? The 2010 plug-in doesn't show and I can't find it to add it manually.

  44. @Jan Roelof – Wed, Feb 16 2011 4:48 PM – Great work !

  45. John Wayne says:

    For some reason sortpage plugin for OneNote 2007 has disappeared from the internet. So I switched to OneNote 2010 and sortpage (for 2010) worked. However this time sort sections wouldn't work. You can buy a Chinese plugin (OneNote Gem) and its sort page and section both work on OneNote 2010.

  46. Jeff Jefferson says:

    Using windows 7 64 bit with OneNote 2010

    I intalled Sort Page and Sort Sections. The icons appear, but clicking them doesn't give any results. With the exception that the words 'Sort Pages' turn to grey.

    Any suggestions?

  47. Jeff Jefferson says:

    Doesn't John Guin reply anymore?

  48. JohnGuin says:

    Well, I had a busy weekend 🙂

    If you look in the folder to where you installed the addon, there should be a log file there.  Can you see what error code was logged?

  49. Jeff Jefferson says:

    Sorry John for my late reaction, but my last post didn't get registered.

    So once again:

    In Program Files 86)/ ONote PowerToys / OneNote 2010 Sort Pages

    there is logfile to be found.


    OneNote2010_red_allformats.ico & SortPsAddinl.dll

  50. Lilly Addison says:

    Hey there,

    Can this add in also sort the notebooks on the left panel?

  51. John says:

    Lily – no, no one has written a sorter for that.  Most folks only have a few notebooks so drag/drop to sort may actually be faster.

    Jeff – I'm looking through the repository to see what I can find here.  Can you also contact me via email (link is at upper right)?  I want to get a diagnostic file from your machine that may help troubleshoot this.

  52. Paul says:

    Just a note of thanks for the great utility!

  53. David says:

    Works a dream and many thanks!

  54. Michael Perrenoud says:

    The algorithm used to sort leveled pages isn't correct. It in fact decouples the children from the parent (e.g. Training is the root, Tasks is the parent, and Glossary is the leaf) when sorting is done you have Training at the root (sorted properly), then you see Glossary (two levels in) and then you see Tasks (one level in) and so it effectively decoupled the child from the parent.

  55. John says:

    Michael – you are correct.  I had noticed that long ago but never remembered to try and fix it.  If you like, you can fix it and I can post your update here.  Just contact me through the email link at the upper right if you want.

  56. Matt says:

    Is there a version that will work for OneNote 2013?

  57. John says:

    I have not updated it for 2013 and need to admit I won't have time.  If anyone does update this, I can give out the source code and post your updates here – any takers?

  58. Geoff Wales says:

    Thanks very much.

  59. Chuck says:

    AWESOME worked like a champ DANK U

  60. M@ says:

    Anyone find a way to sort pages in Office 2010 64-bit ? all of these powertoys add ins throw errors! Think i will abandon onenote.. evernote?

  61. Neal says:

    John, I've only made add-ins for Excel, but would be interested in getting this working for OneNote 2013. Any advice on whether it'll be a straightforward matter or if I'll be in over my head?

  62. John says:

    It should only be Ribbon changes and a simple namespace change.  Malte Ahrens did a nice article on how to get ribbon addins working so that might be a good place to start.

    If you update this, let me know and I can post it here if you like.  Thanks!

  63. Nathan says:

    I am using OneNote 2010 and find it invaluable. You've just made it even more invaluable for me. Thank you very much for this. It appears to work a treat!

    Best regards, Nathan

  64. Lisa says:

    This is great but my work computer requires an admin password to add anything like this, so I am stuck

  65. Eric says:

    This doesn't work when I used it. The Sort Pages button is in the toolbar, but clicking just disables the button, and it does nothing.

  66. Anonymous says:

    You have really helped improve on OneNote 2010. Well Done.

    Having the pages sorted … Fantastic.

    I ran the .exe file As Administrator.

    🙂 Thanks