PST'de MapiNote ile Çalışma
Contents
[
Hide
]
PST’ye MapiNote Ekleme
Yeni PST Oluştur, Alt Klasörler ve Mesajlar Ekle PST dosyası oluşturup bir alt klasör eklemenin nasıl yapılacağını gösterdi. Aspose.Email ile oluşturduğunuz veya yüklediğiniz bir PST dosyasının Notlar alt klasörüne bir MapiNote ekleyebilirsiniz.
Aşağıda MapiNote’u bir PST’ye eklemek için adımlar verilmiştir:
- Microsoft Outlook kullanarak bir şablon MapiNote oluşturun ve MSG dosyası olarak kaydedin.
- Kaydedilmiş MSG notunu şuraya yükle: MapiMessage nesne.
- Bir oluştur MapiNote nesne ve şablon MSG notunu yükleyin.
- Şunu ayarlayın: MapiNote özellikleri farklı yöntemlerle.
- Şu şekilde bir PST oluşturun PersonalStorage.create() metod.
- Kök klasöre erişip ardından aşağıdaki yöntemi çağırarak PST dosyasının köküne önceden tanımlı bir (Notlar) klasörü oluşturun. addMapiMessageItem() metod.
Aşağıdaki kod parçacığı bir … nasıl oluşturulacağını gösterir MapiNote ve ardından yeni oluşturulan bir PST dosyasının Notlar klasörüne ekleyin.
// For complete examples and data files, please go to https://github.com/aspose-email/Aspose.Email-for-Java
String dataDir = "data/";
MapiMessage source = MapiMessage.load(dataDir + "Note.msg");
// Note #1
MapiNote note1 = (MapiNote) source.toMapiMessageItem();
note1.setSubject("Yellow color note");
note1.setBody("This is a yellow color note");
// Note #2
MapiNote note2 = (MapiNote) source.toMapiMessageItem();
note2.setSubject("Pink color note");
note2.setBody("This is a pink color note");
note2.setColor(NoteColor.Pink);
// Note #3
MapiNote note3 = (MapiNote) source.toMapiMessageItem();
note3.setSubject("Blue color note");
note3.setBody("This is a blue color note");
note3.setColor(NoteColor.Blue);
note3.setHeight(500);
note3.setWidth(500);
PersonalStorage pst = PersonalStorage.create(dataDir + "MapiNoteToPST_out.pst", FileFormatVersion.Unicode);
FolderInfo notesFolder = pst.createPredefinedFolder("Notes", StandardIpmFolder.Notes);
notesFolder.addMapiMessageItem(note1);
notesFolder.addMapiMessageItem(note2);
notesFolder.addMapiMessageItem(note3);