# OneNoteNotebookWriter

Creates a native offline notebook directory containing .onetoc2 and .one files.

Class 

`OfficeIMO.OneNote`

**Namespace**

`OfficeIMO.OneNote`

**Assembly**

`OfficeIMO.OneNote`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[OneNoteNotebookWriter.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Writing/OneNoteNotebookWriter.cs#L15)

**Modifiers**

static

Creates a native offline notebook directory containing .onetoc2 and .one files.

## Inheritance

- object
- OneNoteNotebookWriter

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Read and Write OneNote Notebooks](/docs/onenote/notebooks/) Guide
  
  Open OneNote notebooks from a folder, a .onetoc2 file or a .onepkg export, walk section groups and sections, and write notebooks offline.

Filter members 

Show inherited

## Methods

`public static void Write(OneNoteNotebook notebook, string directoryPath, OneNoteSaveOptions? options = null)` [#](#method-write-officeimo-onenote-onenotenotebook-string-officeimo-onenote-onenotesaveoptions)

[OneNoteNotebookWriter.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Writing/OneNoteNotebookWriter.cs#L15)

Publishes a complete notebook to a new or empty directory. An existing empty directory is populated in place with its root table of contents written last. Open the notebook after this method returns. Existing files are never overwritten.

Parameters

**notebook OfficeIMO.OneNote.OneNoteNotebook required**

**directoryPath string required**

**options OfficeIMO.OneNote.OneNoteSaveOptions? = null optional**

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:D402B3E9E32F84C6880164D2BF84F2620568E39A61AECAFA3CA9CE5BB620CF98 -->
