LinqToOneNote 2.0.0

dotnet add package LinqToOneNote --version 2.0.0
                    
NuGet\Install-Package LinqToOneNote -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LinqToOneNote" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LinqToOneNote" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="LinqToOneNote" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LinqToOneNote --version 2.0.0
                    
#r "nuget: LinqToOneNote, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LinqToOneNote@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LinqToOneNote&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=LinqToOneNote&version=2.0.0
                    
Install as a Cake Tool

LINQ to OneNote

A helper library for dealing with the OneNote Interop API. Originally made for Flow.Launcher.Plugin.OneNote.

LinqToOneNote TODO

//Search pages that have "hello there" in the title or content.
var pages = OneNote.FindPages("hello there");
Page page = pages.FirstOrDefault();

if (page == null)
    return;

Console.WriteLine(page.Name);
page.Open(); // or OneNote.Open(page)
var root = OneNote.GetFullHierarchy();
var items = root.Notebooks
                .Descendants()
                .Take(10);

foreach(var item in items)
{
    Console.WriteLine("Item: " + item.Name + " | Parent:"  + item.Parent?.Name);
}

View the documentation for more information and examples or visit the the API Reference to see the full API.
Most functions return an IEnumerable allowing for easy use with LINQ.

Features

  • Search your OneNote pages. Optionally specify a notebook, section group or section to restrict the search to.
  • Create OneNote items.
  • Open items in OneNote.
  • Rename items.
  • Delete items.
  • Traverse your whole OneNote hierarchy` with Linq To Tree-esque methods:
    • IOneNoteItem.Children
    • IOneNoteItem.Descendants()
    • IOneNoteItem.Ancestors()
    • IOneNoteItem.AfterSelf()
    • IOneNoteItem.BeforeSelf()
  • Query only a part of your OneNote hierarchy with methods in OneNote.Partial. This is especially useful if you have a substantial amount of notes i.e OneNote.GetFullHierarchy() takes too long.
  • Interact with OneNote sections that are not in any Notebook → Root.OpenSections
Product Compatible and additional computed target framework versions.
.NET net9.0-windows7.0 is compatible.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 90 1/3/2026