Working with MapiNote in PST

Adding MapiNote 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 a MapiNote to the Notes subfolder of a PST file that you have created or loaded.

Below are the steps to add MapiNote to a PST:

  1. Create a template MapiNote using Microsoft Outlook and save it as an MSG file.
  2. Load saved MSG note into MapiMessage object.
  3. Create a MapiNote object and load the template MSG note.
  4. Set the MapiNote properties using different methods.
  5. Create a PST using the PersonalStorage.create() method.
  6. Create a pre-defined folder (Notes) 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 MapiNote and then add it to the Notes folder of a newly created PST file.