How can I open OneNote files in a text editor?
Noob here, hi. Reading diagonally the specification for oneNote files (here and here) it seems that oneNote notes are in an XML-like format.
Opening them (.one and .onetoc2 files) with a text editor (VS Code) shows nonsense, so i guess these files are binaries.
Is there a way to open the oneNote files, without OneNote itself? The goal ultimately is to know if I am able to parse through them and access my notes and data, if I want in the future to just move to another application (eg. cherrytree).
It is important to me, before starting using OneNote notebooks, that my notes/data isn't "trapped" in the software. I know I can export notebooks as PDFs, but I'd prefer something more than that.
12 Answers
A OneNote file is in a proprietary format.
Perhaps this method will work:
- In OneNote, save as an MHT file
- In Word, open the MHT file
- Save the file as an HTML file
- Try to import the HTML file into cherrytree. If this does not work, you will need to extract the data from the HTML file in another format.
You might also be interested in the articleBulk export OneNote 2013/2016 pages as HTML, containing the PowerShell script for the export.
I can export notebooks as PDFs, but I'd prefer something more than that.
OneNote 2016 (the desktop version) can export pages (or page ranges) or sections as Word Documents (docx) or Word 97-2003 Documents (.doc). These are editable in other programs, for example OpenOffice or LibreOffice.
For exporting notebooks, the available formats include XPS (Open XML Paper Specification). However, apart from Microsoft there is not much software that can handle XPS files (and most of them are view only). There is a list at .xps Extension - List of programs that can open .xps files
For more information see How to Export Your OneNote 2016 Notes to Different File Formats