By Greg Nowak. Last updated 2026-11-30.
You can still use VBA to automate classic Outlook for Windows or pull data from the OneNote desktop app into Excel. If your team has switched to new Outlook, the first question is what the macro did for the business. Filing one email in a notebook, routing every enquiry from a shared inbox, and collecting project notes for a weekly report each call for a different setup.
Which Outlook and OneNote automation should you use?
Start with the Outlook version your team actually runs. VBA and the Outlook Object Model are available in classic Outlook for Windows only. Both classic and new Outlook offer Send to OneNote, which may be all you need if people file messages by hand. Microsoft’s Outlook feature comparison
| What you need to do | Where to start | What to check first |
|---|---|---|
| Save an occasional email to a notebook | Send to OneNote | The person filing the message can access the destination notebook. |
| Keep an existing Outlook macro running | VBA in classic Outlook for Windows | The team will keep classic Outlook and can run the macro under its Office policy. |
| Export OneNote data from an existing Excel workbook | Excel VBA and the OneNote desktop COM interface | The workbook can read a sample page on the Windows setup your team uses. |
| Turn incoming Microsoft 365 email into notebook pages | Power Automate | The flow connections can access the mailbox and the destination section. |
| Read cloud notebooks from a custom application | Microsoft Graph | The application can use delegated access through a user with notebook permissions. |
How to pull OneNote data into Excel with VBA
For an existing Windows workbook, Excel runs the macro and calls the OneNote desktop app through its COM interface. If the workbook uses an early-bound reference, open Tools > References in the VBA editor and check that it points to the OneNote object library installed on that PC. Start with one notebook section and one page you can check by hand.
- Call
GetHierarchywith the section ID and thehsPagesscope to get the page list as XML. Use a namespace-aware XML parser to extract the page IDs and titles. - Pass each selected page ID to
GetPageContentto retrieve its content as XML. Use the same explicit schema version for both calls, such asxs2013, and match your parser to that namespace. - Map the fields you need to an Excel table. Keep the page ID with each row so a rerun can update an existing entry. Put pages with missing or unexpected fields in a review list so someone can correct them.
For a weekly project report, try extracting just the page title, owner and next action. A consistent page template makes those fields easier to read reliably. Test one page with a missing owner and another with a pasted table before you rely on the export. Microsoft’s OneNote desktop Application interface reference
Use Power Automate for a shared inbox workflow
For a team that wants to turn selected messages into handover notes, start with the Office 365 Outlook trigger When a new email arrives in a shared mailbox (V2). Give the connection account access to the mailbox and use a narrow filter, such as a subject prefix, for the pilot. Microsoft documents that the trigger may skip protected or oversized messages, so test the messages your workflow is expected to handle and agree who checks the inbox for exceptions. Microsoft’s Office 365 Outlook connector reference
Then add the OneNote (Business) action Create page in a section. Choose the destination section and set the title in the page HTML with <title>. Include the fields people need for the handover, such as the subject, received date and reference number. Check who can read the destination notebook before copying message content. Record the source message ID so a colleague can check for an existing page before retrying a failed run. Microsoft’s OneNote (Business) connector reference
Check the sign-in model before building with Microsoft Graph
Microsoft Graph is an option when a custom application needs to work with cloud notebooks. A first read can start with GET https://graph.microsoft.com/v1.0/me/onenote/pages to list pages available to the signed-in user. The OneNote API requires delegated authentication, so test with an account that has the same access as the intended users. If the job must run solely under an application identity, pick a data store that supports app-only access before you commit to the design. Microsoft’s OneNote REST API overview
Pilot one workflow before rolling it out
Pick one mailbox or notebook section and write down what should happen, what counts as a successful run and who handles exceptions. Have the person who will own the workflow run the pilot and recover from a failed example. That gives you a concrete basis for deciding whether to keep a macro or rebuild it.
If you have a macro to replace or a manual handover to simplify, send Greg a short description of the workflow and the output your team needs. A sample with sensitive details removed is enough to start the conversation.
Related on GrN.dk
- Browser Automation for Operations and Agency Teams: What Should You Automate?
- Google Can Call Your Business. Is Your Local Data Ready?
- Search Console Can See Social Posts—Your Reports Need a New Map
Need help with this kind of work?
Share your Outlook or OneNote workflow with Greg and discuss whether to keep the macro or move it to a cloud flow. Get in touch with Greg.