Create, Save and Read Outlook Notes
This article covers standalone Outlook MapiNote items saved as MSG. To store and read notes inside a PST, see Managing Tasks, Journals, and Notes in PST Files.
Create and Save Outlook Notes
Aspose.Email provides the facility to create Outlook notes and save them to disk in MSG format. The MapiNote class provides properties and methods for setting note information. This article shows how to create, save and read a MapiNote from the disk.
The following steps can be used to create and save a note to disk:
- Instantiate an object of the MapiNote class.
- Set various properties.
- Save the note to disk as an MSG file.
The following code snippet shows you how to create and save an Outlook Note.
// The path to the File directory.
string dataDir = RunExamples.GetDataDir_Outlook();
// Create MapiNote and set Properties
MapiNote note3 = new MapiNote();
note3.Subject = "Blue color note";
note3.Body = "This is a blue color note";
note3.Color = NoteColor.Blue;
note3.Height = 500;
note3.Width = 500;
note3.Save(dataDir + "MapiNote_out.msg", NoteSaveFormat.Msg);
Read MAPI Notes
The MapiNote class object is used to cast the MapiMessage object that loads a note from the disk in MSG format. The following code snippet shows you how to read a MapiNote.
// The path to the File directory.
string dataDir = RunExamples.GetDataDir_Outlook();
MapiMessage note = MapiMessage.FromFile(dataDir + "MapiNote.msg");
MapiNote note2 = (MapiNote)note.ToMapiMessageItem();
See Also
- Managing Tasks, Journals, and Notes in PST Files — store and read tasks, journals, and notes inside a PST.
- Create, Save and Read Outlook Tasks — work with standalone
MapiTaskitems.