Extending possibilities with Macros

September 20, 2012

Extending the capabilities of OneNote is possible thanks to OneNote Object Model. Add-ins like Onetastic is built using those APIs OneNote exposes to read and update content in OneNote. However building an add-in is not a simple task for average user, and it is not scalable for me either when considering different requirements of millions of users. Compare this to other Office applications like Excel, where you can start up VBA editor and find some VBA code online that does what you need to do and voilà! You just performed a task that Excel didn't provide in a form of ribbon button. As easy as it is to use OneNote, it unfortunately lacks this ease when it comes to extensibility.

To cope with this difficulty, Onetastic now comes with Macros which you can build yourself whenever you need to perform some simple repeated task, or even some complex tasks that OneNote does not itself perform. The model is different than macros in other Office apps, for instance no VBA is involved, but the idea is similar.

This first version of Macros can find objects on the current page based on conditions specified and modify properties of those objects. This may sound somewhat limited but it is amazingly powerful and you can accomplish a lot of things with it. Onetastic ships with several macros, ranging from very simple to very complex to demonstrate the capabilities. The good thing is, using Macro Editor, you can inspect those macros, play with them and modify them, and start building your own macros. You can also easily share the macros you build with other users.

Here are the set of macros Onetastic currently comes with:

Most of these are self-explanatory. You can try them out and see how they work. The Table-Function macro is a bit more complicated than others and I explain how to use it here. All these macros will be available on Home tab with each category as a drop down:

Macro buttons in Home ribbon tab

If you want, you can also get an expanded view by going to Settings > Show in a Separate Tab and all macros will show up in Macros tab:

Macro buttons in a separate ribbon tab

You can add more categories and macros yourself using Macro Editor, which you can launch from New Macro button, or edit existing macros again in Macro Editor using the Edit Macros dropdown, which will list all the available macros. To get more info on how to build macros, read the tutorial here.

Macro Editor

Macros can be built and edited through the Macro Editor, which looks like below:

Macro editor

Here you can set the name, category and description of the macro and below that you can see the set of commands at your disposal on the left and the macro you are building on the right. You can also Export the macro as XML and share with others, and import the XML back into the macro editor.

Macro export

All right, go ahead and enjoy the macros that come pre-installed, and then start building your own macros. Make sure to check-out the tutorial and let me know any questions you might have. Hopefully this will enable whole new scenarios and make it much easier to use OneNote.


Omer Atay - 2017-11-06
Andy Glew: That is correct, user defined functions are currently not supported
Andy Glew - 2017-11-05
Macros are great.
Macros with user defined functions are even greater.
AFAICT the OneTastic macro language does not have user defined functions, does it?
Omer Atay - 2017-02-21
Dan: Backslash+quote (\") will encode a quote.

Other Posts

Show all posts