Working with Outlook Notes
Contents
[
Hide
]
Creating, Saving and Reading Notes
Aspose.Email provides the facility to create Outlook notes and save them to disc in MSG format. The MapiNote class provides properties and methods for setting task information. This articles shows how to create, save and read a MapiNote from disc.
Creating and Saving an Outlook Note
The following steps can be used to create and save a note to disc:
- Instantiate an object of the MapiNote class.
- Set various properties.
- Save the note to disc as an MSG file.
The following code snippet shows you how to creating and saving 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/kashifiqb/Aspose.Email-for-C | |
// The path to the File directory. | |
System::String dataDir = RunExamples::GetDataDir_Outlook(); | |
// Create MapiNote and set Properties | |
System::SharedPtr<MapiNote> note3 = System::MakeObject<MapiNote>(); | |
note3->set_Subject(L"Blue color note"); | |
note3->set_Body(L"This is a blue color note"); | |
note3->set_Color(Aspose::Email::Outlook::NoteColor::Blue); | |
note3->set_Height(500); | |
note3->set_Width(500); | |
note3->Save(dataDir + L"MapiNote_out.msg", Aspose::Email::Outlook::NoteSaveFormat::Msg); |
Reading a MapiNote
The MapiNote class object is used to cast the MapiMessage object that loads a note from disc 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/kashifiqb/Aspose.Email-for-C | |
// The path to the File directory. | |
System::String dataDir = RunExamples::GetDataDir_Outlook(); | |
System::SharedPtr<MapiMessage> note = MapiMessage::FromFile(dataDir + L"MapiNote.msg"); | |
System::SharedPtr<MapiNote> note2 = System::DynamicCast<Aspose::Email::Outlook::MapiNote>(note->ToMapiMessageItem()); |