// This code example demontstrates how to create a new OneNote document and convert it to HTML. // create an object of the Document class Document doc = new Document(); // Add a new Page Page page = new Page(); // Specify TextStyle and set formatting properties ParagraphStyle titleTextStyle = new ParagraphStyle() .setFontColor(Color.black) .setFontName("Arial") .setFontSize(20); // Specify title text RichText titleText = new RichText().append("This is a Title!"); titleText.setParagraphStyle(titleTextStyle); // Initialize Title Title title = new Title(); title.setTitleText(titleText); // Set page title page.setTitle(title); // Add Page node doc.appendChildLast(page); // Save OneNote document as HTML doc.save("C:\\Files\\CreateOneNoteDocAndSaveToHTML_out.html", SaveFormat.Html);