Working with Outlook Notes
Contents
[
Hide
]
Create, Save and Read Outlook Notes
Aspose.Email provides the facility to create Outlook notes and save to disk in MSG format. The MapiNote class provides properties and methods to set the desired information for a note. This article shows how to create, save and read a MapiNote from the disk.
Create and Save Outlook Note
The following steps can be used to create and save a note to disk.
- Instantiate an object of the MapiNote class.
- Set various properties as desired.
- Save the note to disk as an MSG file.
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-Java MapiNote note3 = new MapiNote(); note3.setSubject("Blue color note"); note3.setBody("This is a blue color note"); note3.setColor(NoteColor.Blue); note3.setHeight(500); note3.setWidth(500); note3.save(dataDir + "MapiNote_out.msg", NoteSaveFormat.Msg);
Read a MapiNote
The MapiNote class object is used to cast the MapiMessage object that loads a note from disk in MSG format.
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-Java | |
MapiMessage note = MapiMessage.fromFile(dataDir + "MapiNote_out.msg"); | |
MapiNote note2 = (MapiNote) note.toMapiMessageItem(); |