Working with MapiJournal in PST

Adding MapiJournal to PST

Create New PST, Add Sub-folders and Messages showed how to create a PST file and add a subfolder to it. With Aspose.Email you can add MapiJournal to the Journal subfolder of a PST file that you have created or loaded. Below are the steps to add MapiJournal to a PST:

  1. Create a MapiJournal object.
  2. Set the MapiJournal properties using a constructor and methods.
  3. Create a PST using the PersonalStorage.create() method.
  4. Create a pre-defined folder (Journals) at the root of the PST file by accessing the root folder and then calling the addMapiMessageItem() method.

The code snippet below shows how to create a MapiJournal and then add it to the Journal folder of a newly created PST file.

Adding Attachments to MapiJournal

It is also possible to add attachments to MAPI journal items. The code below shows how.