Custom PST

There is some another query :

  1. Please give me some suggestion to get the read or unread status of a mapimessage.
  2. when i create a pst file.The “Deleted Items” folder aumatic created. I don’t want to create this folder. I use this code

PersonalStorage pst = PersonalStorage.Create(savePath + pstFileName + “.pst”, FileFormatVersion.Unicode);

How can i Solve this issue??

@alibardisk,

  1. For getting read or unread status of a MapiMessage, you can use the following code:

    using (PersonalStorage pst = PersonalStorage.FromFile(“1.pst”))
    {
    FolderInfo folder = pst.RootFolder.GetSubFolder(“Inbox”);

     foreach (string entryId in folder.EnumerateMessagesEntryId())
     {
         MapiMessageFlags flags = (MapiMessageFlags)pst.ExtractProperty(Convert.FromBase64String(entryId), MapiPropertyTag.PR_MESSAGE_FLAGS).GetInt32();
    
         if ((flags & MapiMessageFlags.MSGFLAG_READ) == MapiMessageFlags.MSGFLAG_READ)
         {
             // Your code…
         }
     }
    

    }

  2. There is no such way to avoid the creation of Delete Items folder while creating new PST file.

Good morning…
Thank You sir

A post was split to a new topic: Creating folders on Exchange