No. Although OneNote is positioned and marketed as part of MS Office, it does not support VBA. There is an add-on (for OneNote 2010, 2013, 2016 for Windows only) called Onetastic that adds a lot of features and also includes a simple macro language. While it contains powerful commands and functions to manipulate note content, it does not offer much to control OneNote itself. Generally, Onetastic is free, but since version 3.0 the use of macros costs a fee.
New: OneNote App Will Move Local Notebooks to the Cloud
The March update enables the OneNote app for Windows 10 to transfer locally saved notebook …