Free Support Forum - aspose.com

Read out OneNote "Task" checkboxes

Hi,

does someone know how to read out a “task” checkbox from a onenote page? If it is checked or not is the information to read out…
Maybe example code for c#?

Thank you,

Rob

@Robster55,
Thank you for your query.

Please give a try to the following sample code and share the feedback. If it does not fulfill your requirements, please share your runnable sample code and template OneNote file for our testing. We will analyze the information here and provide assistance accordingly.

Document oneFile = new Document(path + "Test File.one");

// Get all RichText nodes
IList<RichText> nodes = oneFile.GetChildNodes<RichText>();

// Iterate through each node
foreach (RichText richText in nodes)
{
    foreach (var tag in richText.Tags)
    {
        if(tag is NoteTag)
        {
            NoteTag noteTask = (NoteTag)tag;
            // Retrieve properties
            Console.WriteLine("Completed Time: " + noteTask.CompletedTime);
            Console.WriteLine("Create Time: " + noteTask.CreationTime);
            Console.WriteLine("Status: " + noteTask.Status);
            Console.WriteLine("Icon: " + noteTask.Icon);
            Console.WriteLine("Label: " + noteTask.Label);
            Console.WriteLine("Text: " + richText.Text);
        }
    }
}

Test File.one.zip (2.8 KB)