Class PersonalStorage

PersonalStorage class

Represents Personal Storage Table (.pst) file.

public class PersonalStorage : IDisposable

Constructors

NameDescription
PersonalStorage(TraversalExceptionsCallback)Initializes a new instance of the PersonalStorage class. Allows setting a callback method for handling exceptions that occur during PST traversal.

Properties

NameDescription
CanWrite { get; }Gets a value indicating whether the current pst supports writing.
Format { get; }Gets the file format.
IsUnicode { get; }Gets a value indicating whether the PST file format is Unicode. There are two versions of the PST file format: Unicode and ANSI.
RootFolder { get; }Gets the root folder of PST.
Store { get; }Gets the PST message store.

Methods

NameDescription
static Create(Stream, FileFormatVersion)Creates the PST in a stream.
static Create(string, FileFormatVersion)Creates the new PST file with the specified file name.
static Create(Stream, FileFormatVersion, bool)Creates the PST in a stream.
static Create(Stream, FileFormatVersion, CancellationToken)Creates the PST in a stream.
static Create(string, FileFormatVersion, CancellationToken)Creates the new PST file with the specified file name.
static Create(Stream, FileFormatVersion, bool, CancellationToken)Creates the PST in a stream.
static FromFile(string)Load PST from file.
static FromFile(string, bool)Load PST from file.
static FromFile(string, CancellationToken)Load PST from file.
static FromFile(string, PersonalStorageLoadOptions)Load PST from file.
static FromFile(string, bool, CancellationToken)
static FromFile(string, PersonalStorageLoadOptions, CancellationToken)Load PST from file.
static FromStream(Stream)Load PST from stream.
static FromStream(Stream, bool)Load PST from stream.
static FromStream(Stream, CancellationToken)Load PST from file.
static FromStream(Stream, PersonalStorageLoadOptions)Load PST from stream.
static FromStream(Stream, bool, CancellationToken)
static FromStream(Stream, PersonalStorageLoadOptions, CancellationToken)Load PST from file.
ChangeMessage(string, MapiPropertyCollection)Changes the message properties.
ConvertTo(FileFormat)Converts the current object to the specified format.
CreatePredefinedFolder(string, StandardIpmFolder)Creates the standard interpersonal message (IPM) folder.
CreatePredefinedFolder(string, StandardIpmFolder, bool)Creates the standard interpersonal message (IPM) folder.
DeleteItem(string)Deletes the item (folder or message) by it’s entryId
Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
EnumerateMessages(string)Exposes the enumerator, which supports an iteration of messages in folder.
EnumerateMessages(string, int, int)Exposes the enumerator, which supports an iteration of messages in folder.
ExtractAttachments(MessageInfo)Extracts the attachments.
ExtractAttachments(string)Extracts the attachments.
ExtractMessage(byte[])Get the message from PST.
ExtractMessage(MessageInfo)Get the message from PST.
ExtractMessage(string)Get the message from PST.
ExtractProperty(byte[], long)Gets the specified property of item, without extract the item fully.
FindMessages(string)Finds the identifiers of messages for for the current folder. It might be useful in case of reading corrupted pst when the GetContents and EnumerateMessages methods could throw an exception.
FindSubfolders(string)Finds the identifiers of subfolders for for the current folder. It might be useful in case of reading corrupted pst when the GetSubfolders and EnumerateFolders methods could throw an exception.
GetFolderById(byte[])Gets the personal folder from PST.
GetFolderById(string)Gets the personal folder from PST.
GetParentFolder(byte[])Gets the parent folder of message.
GetParentFolder(string)Gets the parent folder of message.
GetPredefinedFolder(StandardIpmFolder)Gets the standard interpersonal message (IPM) folder from PST. Outlook can create a number of default folders, such as Outbox, Deleted Items, Sent Items etc.
Load(Stream)Load PST from stream. This method is used when a PersonalStorage object is created using the constructor.
Load(string)Load PST from file. This method is used when a PersonalStorage object is created using the constructor.
MergeWith(Stream[])Merges the pst storage with one or more other pst streams. Thus, the combined stream are sources.
MergeWith(string[])Merges the pst storage with one or more other pst files. Thus, the combined files are sources.
MoveItem(FolderInfo, FolderInfo)Moves a specified folder to a new parent folder within the current pst.
MoveItem(MessageInfo, FolderInfo)Moves a specified message to a new folder within the current pst.
SaveAs(Stream, FileFormat)Saves the current object to a specified file format in a stream.
SaveAs(string, FileFormat)Saves the current object to a specified file format in a different file.
SaveMessageToStream(string, Stream)Saves the message, with specified entryID, to a stream.
SplitInto(IList<MailQuery>, string)Splits the pst storage based on criteria.
SplitInto(long, string)Splits the pst storage into less sized parts.
SplitInto(IList<MailQuery>, string, string)Splits the pst storage based on criteria.
SplitInto(long, string, string)Splits the pst storage into less sized parts.
TryToGetFolderById(string, out FolderInfo)Gets the folder associated with the specified entry ID.
TryToSaveMessage(string, Stream)Saves the message, with specified entryID, to a stream.

Events

NameDescription
event ItemMovedOccurs when an item is moved to the another folder.
event StorageProcessedOccurs in splitting and merging operations when a new chunk of pst is created or the next file is processed and is to be merged.
event StorageProcessingOccurs before the srorage is processed. The event is raised before processing the next storage in merging or splitting operations.

See Also