Managing Outlook MAPI Tasks in PST Files

Add Outlook MAPI Tasks to PST Files

Create New PST File and Add Subfolders demonstrates how to create a PST file and include subfolders within it. With Aspose.Email you can also add MAPI Tasks to the Tasks subfolder of a PST file that you have created or loaded. The code sample below demonstrates how to create and manage a task using the MapiTask class in an environment that supports manipulating personal storage table (PST) files. It defines a task with specific parameters and then saves this task to a PST file under a predefined “Tasks” folder.

  1. Create a MapiTask object setting the start date to the current date and the due date to three days from now.
  2. Set the task properties.
  3. Create a PST using the PersonalStorage.Create() method.
  4. Create a pre-defined folder (Tasks) at the root of the PST file by accessing the Root folder and then calling the add_mapi_message_item() method.