Compartilhar via


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: https://blogs.msdn.com/b/johnguin/archive/2011/04/28/updated-the-onenote-table-of-contents-and-sorter-powertoy.aspx looking under my signature at the end of this article.

 

Description:

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)

clip_image001

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

clip_image002

 

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

image

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

 

Notes:

  • 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.

Setup:

There are 2 setup files included at this page: https://blogs.msdn.com/b/johnguin/archive/2011/04/28/updated-the-onenote-table-of-contents-and-sorter-powertoy.aspx. 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,
John

Comments

  • Anonymous
    October 23, 2010
    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, John

  • Anonymous
    November 11, 2010
    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; Aud Aab Aba It returns; Aba Aud Aab


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.

  • Anonymous
    November 12, 2010
    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.

  • Anonymous
    November 16, 2010
    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.

  • Anonymous
    November 16, 2010
    I guess I just needed to read your next blog post!

  • Anonymous
    November 23, 2010
    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. thanks

  • Anonymous
    January 10, 2011
    Wow, this is perfect. Thanks for sharing.  Have been struggling for a year until I found this!

  • Anonymous
    February 01, 2011
    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?

  • Anonymous
    February 02, 2011
    Can you send me an email from the link at the upper right?  I have a file I want to send you.

  • Anonymous
    February 02, 2011
    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.

  • Anonymous
    February 02, 2011
    No, the table sorting only works with ON 2010.  Might be a good learning project for someone to backport...

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

  • Anonymous
    March 05, 2011
    On x64 ,changed the bat file,but no addin visible............

  • Anonymous
    March 06, 2011
    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.

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

  • Anonymous
    March 19, 2011
    I updated the files recently - can you download and try again?

  • Anonymous
    March 20, 2011
    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.

  • Anonymous
    March 21, 2011
    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.

  • Anonymous
    March 22, 2011
    I downloaded it and reinstalled TOC today. No change, still doesn't show up in OneNote.

  • Anonymous
    March 31, 2011
    The comment has been removed

  • Anonymous
    April 01, 2011
    The comment has been removed

  • Anonymous
    April 03, 2011
    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.

  • Anonymous
    April 04, 2011
    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?

  • Anonymous
    April 04, 2011
    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!

  • Anonymous
    April 05, 2011
    I'm running OneNote Version: 14.0.4760.1000 (64-bit)

  • Anonymous
    May 04, 2011
    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.  

  • Anonymous
    May 04, 2011
    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.

  • Anonymous
    May 05, 2011
    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.  

  • Anonymous
    May 06, 2011
    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.
  • Anonymous
    May 08, 2011
    Uninstall, reboot, reinstall worked! (BTW, I had no other plugins, so I skipped that step).

  • Anonymous
    June 13, 2011
    Hi, 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. Thanks, Nick

  • Anonymous
    June 13, 2011
    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.

  • Anonymous
    June 20, 2011
    I just installed the 64-bit version but I also can't get the add-on to appear in the ribbon.

  • Anonymous
    February 06, 2012
    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

  • Anonymous
    February 13, 2012
    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?

  • Anonymous
    May 27, 2012
    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.

  • Anonymous
    June 01, 2012
    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.

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

  • Anonymous
    February 05, 2013
    Did you reinstall the addin?  Or take any other troubleshooting steps?

  • Anonymous
    June 04, 2013
    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?

  • Anonymous
    June 05, 2013
    Ari - do you have any other addins installed?

  • Anonymous
    June 09, 2013
    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?

  • Anonymous
    June 09, 2013
    This would be great if you have an update for office 2013 / OneNote 2013! I will show this week if you have any updates.

  • Anonymous
    June 09, 2013
    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.