Skip to content

Odotocodot/Linq2OneNote

Repository files navigation

logo LINQ to OneNote logo mini

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

Installation

Get the library from NuGet here:

dotnet add package Odotocodot.OneNote.Linq

Usage

Visit the API Reference to see the full API, or visit the Flow Launcher plugin to see it in action.
To see an outline of the library view the class diagram.

⭐ See the documentation for more information and examples! ⭐

Quick Start

The main entry point of the library is the static class OneNoteApplication which has a collection of methods that interact with your OneNote installation.

Below is quick example on using the library to search your OneNote pages.

using System.Linq;
using Odotocodot.OneNote.Linq;

namespace Linq2OneNoteExample
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //Search pages that have "hello there" in the title or content.
            IEnumerable<OneNotePage> pages = OneNoteApplication.FindPages("hello there");
            
            OneNotePage page = pages.FirstOrDefault();

            Console.WriteLine(page.Name);
            
            page.OpenInOneNote();
        }
    }
}

Most functions return an IEnumerable allowing for easy use with LINQ.

Features

  • Search your OneNote pages, and optionally specify a notebook, section group or section to restrict the search to.
  • Traverse your whole OneNote hierarchy.
  • Create a new notebook, section group, section, or page in OneNote.
  • Open a notebook, section group, section, or page in OneNote.

Inspired By

About

A helper library for dealing with the OneNote Interop API.

Topics

Resources

License

Stars

Watchers

Forks

Languages