Trabalhando com Notas do Outlook
Contents
[
Hide
]
Criando, Salvando e Lendo Notas
Aspose.Email fornece a capacidade de criar notas do Outlook e salvá-las em disco no formato MSG. A classe MapiNote fornece propriedades e métodos para definir informações de tarefa. Este artigo mostra como criar, salvar e ler um MapiNote do disco.
Criando e Salvando uma Nota do Outlook
Os seguintes passos podem ser utilizados para criar e salvar uma nota em disco:
- Instanciar um objeto da classe MapiNote.
- Definir várias propriedades.
- Salvar a nota em disco como um arquivo MSG.
O seguinte código mostra como criar e salvar uma Nota do Outlook.
This file contains hidden or 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); |
Lendo um MapiNote
O objeto da classe MapiNote é usado para converter o objeto MapiMessage que carrega uma nota do disco no formato MSG. O seguinte código mostra como ler um MapiNote.
This file contains hidden or 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()); |