Работа с заметками Outlook
Contents
[
Hide
]
Создание, сохранение и чтение заметок
Aspose.Email предоставляет возможность создавать заметки Outlook и сохранять их на диск в формате MSG. Класс MapiNote предоставляет свойства и методы для установки информации о задаче. В этой статье показано, как создать, сохранить и прочитать MapiNote с диска.
Создание и сохранение заметки Outlook
Следующие шаги можно использовать для создания и сохранения заметки на диск:
- Создать объект класса MapiNote.
- Установить различные свойства.
- Сохранить заметку на диск как файл MSG.
Следующий фрагмент кода показывает, как создать и сохранить заметку Outlook.
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); |
Чтение MapiNote
Объект класса MapiNote используется для приведения объекта MapiMessage, который загружает заметку с диска в формате MSG. Следующий фрагмент кода показывает, как прочитать 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(); |