TOC in Current Section

Description : Creates a new page with table of contents of the current section


Author(s) : Omer Atay
Category : TOC
Last Updated : April 24, 2018
Requirements : OneNote 2010 or above
Watch this short video to learn more about this macro
Screenshot :

TOC in Current Section

Select link generation mode. In "Resilient" mode links to pages and sections will still work even if they are renamed, however this mode is slow. In "Fast" mode links will no longer work if pages or sections are renamed, but it goes much faster
Link Generation Mode
TOC Page Mode
Changelog :

April 24, 2018 (64EC8F) - Omer Atay
Now remembers the Link Generation Mode and TOC Page Mode settings each time it runs

July 21, 2017 (84A010) - Omer Atay
Fixed an issue where TOC links in Fast Mode would not work.

December 27, 2016 (F62144) - Omer Atay
Added options for Fast vs Resilient link mode and ability to update existing TOC page.

July 30, 2016 (7C654E) - Omer Atay
TOC now uses indents for subpages so that it can be collapsed

June 20, 2016 (77F7AE) - Omer Atay
Re-written with the new Macro Language to take advantage of cleaner syntax and performance improvements

These versions are no longer supported:

March 10, 2013 - Omer Atay
Initial version


madmatt - 2019-04-23
Any way to have the Main Page bold in the TOC?
Also, some of the links in the TOC are underlined like you would expect a hyperlink to look, but most have a dashed underline. Not sure if that is just something with my system.
Unknown112233 - 2018-09-06
I am trying to use this macro to fit my need. I am a project manager for 2 sales representatives. I have my notebook set up where all the sections are a different job. Each section has a Generic About info including sales engineer name and id #. Is it possible for me to use this macro not only create/update TOC, but with a formatted table instead of a list. Portions of that table would come from each section.

For example, in 12 sections, i have 12 jobs from 3 engineers with job IDs, is it possible for this macro to gather info from the jobs and create/update the table with the data gathered.

Please let me know
Ellie - 2018-01-07
Just used this one, today, and it was SO HELPFUL!!
I had to switch pc's and had made multiple backups of my notebooks over the last weeks and am totally paranoid that I'm going to loose that one little scrap of a note that didn't get copied, for one reason or another.
It worked!
I used this on 2 seemingly identical notebooks, found the one with the info I needed and discarded the unfinished one!
Thanks, Omar!
This macro saved me lots of time and effort!