Save a OneNote Document

Saving a Document to OneNote Format

How does it work?

The save method exposed by the API lets you save the document to OneNote format. The following three overloaded members provide the option to save the document in OneNote format.

  • Save(string)
  • Save(string, OneSaveOptions)
  • Save(string, SaveFormat)

Saving a Document Using Save Options

Saving a Document Using Save Format

Save OneNote Document to a Stream

Users can pass a stream object to the Document.Save(Stream, SaveFormat) method. When saving to a stream, you must specify the save format explicitly.

The following code example demonstrates how to save a document to a stream.

Specify OneNote Save Options

There are overloaded methods for Document.Save method that accept a SaveOptions object. This should be an object of a class derived from the SaveOptions class. Each save format has a corresponding class that holds save options for that format, for example, there is PdfSaveOptions for SaveFormat.Pdf and OneSaveOptions for SaveFormat.One.

The following code example demonstrates how to set save options before saving a document to PDF.