8

I love using OneNote, however I want more control over the locations of my notes and how notes are generated. I'm very versed in VBA and ok with Python (and those are the only languages I can code with on my machine) however I haven't found a decent way to interact with OneNote through code. I'm using OneNote 2003 which doesn't look like it has an xml export like 2007 does. Has anyone figured out an easy way to be able to read and write OneNote files with Python or VBA?

mandroid
  • 2,308
  • 5
  • 24
  • 37

2 Answers2

4

OneNote 2007 has more options, but OneNote 2003 only supports the CSimpleImporterClass API for importing data programmatically into OneNote. CSimpleImporterClass will let you bring in images, ink, and HTML into OneNote using VB.

Reading OneNote 2003 files might be a little harder. I don't know of any resources to make it easy to ready OneNote 2003 files with Python or VBA.

Naaff
  • 9,213
  • 3
  • 38
  • 43
0

For basic CRUD (Create, Read, Update, Delete) operations on OneNote notebooks, sections or pages, you can also use the REST API from Python.

DipakBoyed
  • 434
  • 2
  • 5
  • Started OneTastic\OneNote, but it's not CRUD-y - bad, No opaque object copy. Np copy or cut and paste arbitrary content ( formatted text, images), without object/type specific code. No introspection. Must try XML/API/C#. Q: want to add OneNote Ribbon or Quick Access Toolbar. Unclear how to attach C#/Python/API/XML basher to OneNote menu item. Prefer XML bashing, since many portable tools that are reasonably portable. The other ways seem fragile, likely to change. – Krazy Glew Mar 26 '18 at 04:47