I have seen many articles about this but all of them are either incomplete or do not answer my question. Using C# and the OneNote Interop, I would like to simp
Given task can be easily solved using Aspose.Note. Following code creates a new Document and adds text to its title:
var doc = new Document();
var page = new Page(doc);
page.Title = new Title(doc)
{
TitleText = new RichText(doc)
{
Text = "Title text.",
DefaultStyle = TextStyle.DefaultMsOneNoteTitleTextStyle
},
TitleDate = new RichText(doc)
{
Text = new DateTime(2011, 11, 11).ToString("D", CultureInfo.InvariantCulture),
DefaultStyle = TextStyle.DefaultMsOneNoteTitleDateStyle
},
TitleTime = new RichText(doc)
{
Text = "12:34",
DefaultStyle = TextStyle.DefaultMsOneNoteTitleTimeStyle
}
};
page.AppendChild(outline);
doc.AppendChild(page);
doc.Save("output.one")