Arbeiten mit Aufgaben

Erhalten Sie Outlook -Aufgabendetails aus einem OneNote -Dokument

Die Notetask -Klasse bietet alle Eigenschaften, die sich auf die Outlook -Aufgaben eines Microsoft OneNote -Dokuments beziehen. Alle Outlook -Aufgaben der Datei sind durch RichText -Knoten im Dokument Objekt enthalten. Das unten angegebene Code -Beispiel zeigt, wie Sie Details zu jeder Outlook -Aufgabe von einem OneNote -Dokument abrufen.

 1// The path to the documents directory.
 2string dataDir = RunExamples.GetDataDir_Tasks();
 3
 4// Load the document into Aspose.Note.
 5Document oneFile = new Document(dataDir + "Aspose.one");
 6
 7// Get all RichText nodes
 8IList<RichText> nodes = oneFile.GetChildNodes<RichText>();
 9
10// Iterate through each node
11foreach (RichText richText in nodes)
12{
13    foreach (var tag in richText.Tags)
14    {
15        if (tag is NoteTask)
16        {
17            NoteTask noteTask = (NoteTask)tag;
18            // Retrieve properties
19            Console.WriteLine("Completed Time: " + noteTask.CompletedTime);
20            Console.WriteLine("Create Time: " + noteTask.CreationTime);
21            Console.WriteLine("Due Date: " + noteTask.DueDate);
22            Console.WriteLine("Status: " + noteTask.Status);
23            Console.WriteLine("Task Type: " + noteTask.TaskType);
24            Console.WriteLine("Icon: " + noteTask.Icon);
25        }
26    }
27}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.