Table of Contents

Class OneNoteApplication

Namespace
Odotocodot.OneNote.Linq
Assembly
Odotocodot.OneNote.Linq.dll

A static wrapper class around the Microsoft.Office.Interop.OneNote.Application class, allowing for lazy acquirement and release of a OneNote COM object. In addition to exposing the OneNote's API

public static class OneNoteApplication

Inheritance

Inherited Members

Remarks

A OneNote COM object is required to access any of the OneNote API.

Fields

InvalidNotebookChars

An array containing the characters that are not allowed in a notebook name.
These are: \ / * ? " | < > : % # .

InvalidSectionChars

An array containing the characters that are not allowed in a section name.
These are: \ / * ? " | < > : % # &

InvalidSectionGroupChars

An array containing the characters that are not allowed in a section group name.
These are: \ / * ? " | < > : % # &

RelativePathSeparator

The directory separator used in Odotocodot.OneNote.Linq.IOneNoteItem.RelativePath.

Properties

ComObject

Use this only if you know what you are doing. The COM Object instance of the OneNote application.

HasComObject

Indicates whether the class has a usable COM Object instance.

Methods

CreateNotebook(string, bool)

Creates a notebook with a title equal to name located in the default notebook location.

CreatePage(OneNoteSection, string, bool)

Creates a page with a title equal to name located in the specified section.
If section is null, this method creates a page in the default quick notes location.

CreateQuickNote(bool)

Creates a quick note page located at the users quick notes location.

CreateQuickNote(string, bool)

Creates a quick note page with the title specified by name, located at the users quick notes location.

CreateSection(OneNoteSectionGroup, string, bool)

Creates a section with a title equal to name located in the specified parent section group.

CreateSection(OneNoteNotebook, string, bool)

Creates a section with a title equal to name located in the specified parent notebook.

CreateSectionGroup(OneNoteSectionGroup, string, bool)

Creates a section group with a title equal to name located in the specified parent section group.

CreateSectionGroup(OneNoteNotebook, string, bool)

Creates a section group with a title equal to name located in the specified parent notebook.

FindPages(string)

Get a flattened collection of pages that match the search parameter.

FindPages(string, IOneNoteItem)
Get a flattened collection of pages that match the search parameter. Within the specified scope.
GetBackUpLocation()

Retrieves the path on disk to the backup folder location.

GetDefaultNotebookLocation()

Retrieves the path on disk to the default notebook folder location, this is where new notebooks are created and saved to.

GetNotebooks()

Get all notebooks down to all children.

GetPageContent(OneNotePage)

Gets the content of the specified page.

GetUnfiledNotesSection()

Retrieves the folder path on disk to the unfiled notes section, this is also where quick notes are created and saved to.

InitComObject()

Forcible initialises the static class by acquiring a OneNote COM object. Does nothing if a COM object is already accessible.

IsNotebookNameValid(string)

Returns a value that indicates whether the supplied name is a valid for a notebook.

IsSectionGroupNameValid(string)

Returns a value that indicates whether the supplied name is a valid for a section group.

IsSectionNameValid(string)

Returns a value that indicates whether the supplied name is a valid for a section.

OpenInOneNote(IOneNoteItem)

Opens the item in OneNote (creates a new OneNote window if one is not currently open).

ReleaseComObject()

Releases the OneNote COM object freeing memory.

SyncItem(IOneNoteItem)

Forces OneNote to sync the item.

UpdatePageContent(string)

Updates the content of a OneNote page with the provided xml. The chosen page depends on the ID provided in the xml. An example can be seen here at the Microsoft OneNote API documentation.