Create, Save and Read Outlook Notes
Contents
[
Hide
]
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 task 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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-email/Aspose.Email-for-.NET | |
// 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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-email/Aspose.Email-for-.NET | |
// The path to the File directory. | |
string dataDir = RunExamples.GetDataDir_Outlook(); | |
MapiMessage note = MapiMessage.FromFile(dataDir + "MapiNote.msg"); | |
MapiNote note2 = (MapiNote)note.ToMapiMessageItem(); |