Skip to main content

Offline OneNote automation

Read and Convert OneNote Files Offline in .NET

Read native OneNote .one, .onetoc2, and .onepkg files offline in .NET, then export pages to images, HTML, Markdown, PDF, or search chunks.

OfficeIMO.OneNote reads and writes desktop .one files, FSSHTTP-encoded sections, .onetoc2 notebook tables of contents, .onepkg exports, and notebook directories without Microsoft OneNote or Microsoft Graph.

Use this route when the input is a native file or offline archive. Graph remains the right API when the source of truth is a live Microsoft 365 notebook and the application needs service authentication, permissions, synchronization, or collaboration state.

Read and update a native section

using OfficeIMO.OneNote;

OneNoteSection section = OneNoteSectionReader.Read("Projects.one");
OneNotePage page = section.Pages[0];

var paragraph = new OneNoteParagraph();
paragraph.Runs.Add(new OneNoteTextRun { Text = "Added offline" });
page.DirectContent.Add(paragraph);

section.Save("Projects-updated.one");

Write to a new artifact during migration. Version history and conflict copies are distinct from the current page surface and should be selected deliberately.

Choose semantic or visual output

Required outputPackage or route
Editable Markdown or plain textOfficeIMO.OneNote.Markdown
Accessible semantic HTMLOfficeIMO.OneNote.Html semantic conversion
Position-preserving HTMLOfficeIMO.OneNote.Html visual SVG-page conversion
Selectable-text PDFOfficeIMO.OneNote.Pdf semantic conversion
Position-preserving PDFOfficeIMO.OneNote.Pdf visual conversion
PNG, JPEG, TIFF, WebP, or SVG pagesnative OneNote image and Drawing APIs
Normalized metadata and search chunksOfficeIMO.Reader.OneNote

Semantic output prioritizes headings, text, lists, tables, links, and editing. Visual output prioritizes page placement. One route cannot maximize both for every notebook, so select the fidelity target instead of presenting conversion as lossless.

Bound rendering and extraction

OneNote pages can contain positioned outlines, images, printouts, ink, math, and large embedded payloads. Configure page sizing, source payload limits, maximum raster pixels, feature inclusion, and overflow behavior before processing untrusted notebooks.

Continue with OneNote export and conversion, the OneNote product page, or the OneNote API reference.