Fast Table of Contents and New Macro Icons

December 28, 2016
Some of the most popular macros in Macroland are the Table of Contents (TOC) macros. They are very useful in getting a hierarchical list of all the pages in a sections or notebook with back links to each page. However for a large notebook generating a TOC could take a long time. Most of this time is spent on generating the hyperlinks for each page. OneNote's API requires requesting hyperlinks for each page one by one and this is very slow. The hyperlink generated by OneNote is resilient to changes, so that even if the page's title is changed or the page is moved between sections, it can still find it. All TOC macros are updated with a fast option that will generate links without this resiliency. This can complete in a few seconds, whereas it would take minutes on the slow but resilient mode.

The TOC macros are also updated with an option to update the existing TOC on the current page instead of creating a new page, another common request. The dialog for TOC in Current Notebook macro looks like this:

TOC in Current Notebook macro dialog

Finally a new macro is added to the TOC category: TOC in All Notebooks. This is now made practical with the Fast option if you have lots of notes.

New Macro Icons

When you have too many macros, it may be hard to distinguish them if they all have the same icon. For instance your ribbon may look like below:

Old Macro Icons

You can see that some categories like Find and Sort have specific icons, but many others don't. Macroland now has more than 40 categories and only a handful had specific icons. With the latest update, most of these categories now have specific icons to help distinguish them. Now the same ribbon will look like this:

New Macro Icons

You can find all the new icons below:

All New Macro Icons

Enjoy the update with the new icons, which also comes with some bug fixes and new macros.

Bug Fixes

Show Page XML can't show very long XML

When the page contained lots of content, Show Page XML window was unable to display the page XML. This is now fixed.

Select Text from Image has problem in high DPI

Select Text from Image utility failed to detect the text boundaries correctly on high DPI screens after last update, which should no longer be an issue.

Macro Updates

Following macros in Macroland are updated:

TOC in Current Section

Added options for Fast vs Resilient link mode and ability to update existing TOC page.

TOC in Current Notebook

Added options for Fast vs Resilient link mode and ability to update existing TOC page.

Tag Summary for Specific Tag

This macro can now search up to three tags to find paragraphs that have all of the given tags. Also the tag name is now free form text box so that custom tags or tags in other languages can be searched.

Tag Summary with Page Names

Orders the results first by tag, then by the page they appear in.

Diary Pages

Fixed an issue where the day of the week would be incorrect

Sort Pages By Date

Added option to run the macro in all sections of the current notebook

Extract highlighted Text

Fixed it to correctly extract only the highlighted text. Also now keeps the highlight color in the extracted text.

Tag Summary for Specific Tag

Updated to look for every tag on a paragraph in case it has multiple tags. Previously it only used the first tag on a paragraph.

New Macros

Several new macros have been added to Macroland since the last update. Check them out:

TOC in All Notebooks

Creates a new page with table of contents of all notebooks

Super Color

A macro to change the color of the current page, all pages in current section, current section, all sections in current section group or notebook and the current notebook

Insert Dated Page with Section

Inserts a new page with title as date and section name. Update to 'Insert Dated Page at the Top' to append the section name at the end of the title as well. Also add's the page to the bottom of the section rather than at the top.

Insert User Comment

Insert a Text comment highlighted at end of current paragraph with author's initials

Insert page Title at Cursor

Inserts current page title + " - " at cursor

Custom Grid Lines

Set spacing and color of grid lines to any value.


M. A. - 2017-01-20
Hi Omer,

I am migrating to OneNote 2016 from the Windows store App, and I am trying to make up for the lack of Ink to Shape, as I used that heavily.

Is there a macro command that I can use to switch cursor to shape creation mode (i.e. what it changes to once you select a shape from the draw menu) ? Ideally, I want to create a keyboard shortcut that switches the cursor quickly to one of the drawing modes - rectangle, circle etc.
Omer Atay - 2017-01-18
MS: This is a bug in OneNote. There is no workaround.
MS - 2017-01-18
Another hint:
The text color changes from #ffffff to #979797, so the ratio for red, green and blue is 0.59. This also happens for other colors, #92D050 changes to #74A540, but the ratio is 0.8.

Other Posts

Show all posts

DISCLAIMER: The opinions and views expressed in this website are those of the author and do not necessarily state or reflect those of Microsoft.