Class FolderInfo

FolderInfo class

Represents a folder of a PST or OST file and gives access to its messages and subfolders.

public sealed class FolderInfo

Constructors

NameDescription
FolderInfo()Initializes a new instance of the FolderInfo class.

Properties

NameDescription
ContainerClass { get; }Gets the container class of the folder, which defines the kind of items it holds, for example IPF.Note for mail.
ContentCount { get; }Gets the total number of items in the folder.
ContentUnreadCount { get; }Gets the number of unread items in the folder.
DisplayName { get; }Gets the display name of folder.
EntryId { get; }Gets the entry ID of the folder, which identifies it in the PST.
EntryIdString { get; }Gets the entry ID of the folder as a string.
HasSubFolders { get; }Gets a value indicating whether the Folder object has any subfolders.
LastModificationTime { get; }Gets the last modification time.
Properties { get; }Gets the MAPI properties of the folder.

Methods

NameDescription
AddFile(string, string)Adds a file to the folder as a new item with the specified message class.
AddMapiMessageItem(IMapiMessageItem)Adds a message, contact, appointment, meeting, task, note or journal item to the folder.
AddMessage(MapiMessage)Adds a message to the folder.
AddMessages(IEnumerable<MapiMessage>)Adds messages to the folder in bulk, which is faster than adding them one by one.
AddSubFolder(string)Adds a subfolder with the specified name.
AddSubFolder(string, bool)Adds a subfolder. With createHierarchy, the name can be a path, and the missing folders are created.
AddSubFolder(string, FolderCreationOptions)Adds a subfolder with the specified name to the current folder using the provided creation options.
AddSubFolder(string, string)Adds a subfolder with the specified name and container class.
ChangeContainerClass(string)Changes the container class of the folder.
ChangeDisplayName(string)Renames the folder.
ChangeMessages(MapiPropertyCollection)Sets the specified properties on all messages of the folder.
ChangeMessages(IEnumerable<string>, MapiPropertyCollection)Sets the specified properties on the given messages of the folder.
DeleteChildItem(byte[])Deletes a message or subfolder of this folder by its entry ID.
DeleteChildItems(IEnumerable<string>)Deletes the specified messages of the folder.
EnumerateFolders()Enumerates the subfolders of the folder.
EnumerateFolders(FolderKind)Enumerates the subfolders of the specified kind.
EnumerateMapiMessages()Enumerates the messages of the folder as fully loaded MapiMessage objects.
EnumerateMessageObjects()Enumerates the messages of the folder as MessageObject objects.
EnumerateMessages()Retrieves MessageInfo objects from the folder.
EnumerateMessages(MailQuery)Retrieves a collection of MessageInfo objects that match the specified query.
EnumerateMessages(MessageKind)Retrieves a collection of MessageInfo objects of the specified kind.
EnumerateMessages(int, int)Retrieves a collection of MessageInfo objects starting from a specific index and limited to a specified count.
EnumerateMessagesEntryId()Enumerates the entry IDs of the messages in the folder.
GetContents()Gets information about all messages in the folder.
GetContents(bool)Gets information about the messages in the folder, optionally reading a damaged message list.
GetContents(MailQuery)Gets information about the messages that match a query.
GetContents(MessageKind)Gets information about the messages of the specified kind.
GetContents(int, int)Gets information about a range of the messages in the folder.
GetContents(MailQuery, int, int)Gets information about a range of the messages that match a query.
GetPredefinedType(bool)Gets which standard Outlook folder, such as Inbox or Sent Items, this folder is.
GetSubFolder(string)Gets the subfolder with the specified name.
GetSubFolder(string, bool)Gets the subfolder with the specified name, optionally ignoring case.
GetSubFolder(string, bool, bool)Retrieves a subfolder with the specified name from the current folder.
GetSubFolders()Gets the subfolders of the folder.
GetSubFolders(FolderKind)Gets the subfolders of the specified kind.
GetSubFolders(MailQuery)Gets the subfolders that match a query.
MergeWith(FolderInfo)Merges a folder from another PST into this folder.
MergeWith(FolderInfo, bool)Merges a folder from another PST into this folder and raises ItemMoved for the merged messages and folders.
MergeWithAsync(FolderInfo, CancellationToken)Asynchronously merges a folder from another PST into this folder.
MergeWithAsync(FolderInfo, bool, CancellationToken)Asynchronously merges a folder from another PST into this folder and raises ItemMoved for the merged messages and folders.
MoveContents(FolderInfo)Moves all messages of this folder to another folder.
MoveSubfolders(FolderInfo)Moves all subfolders of this folder to another parent folder.
RetrieveFullPath()Gets the path of the folder from the root of the PST.
SetReadStatus(IList<string>, bool)Sets or clears the Read status for the specified messages in a PST file.
UpdateMessage(string, MapiMessageItemBase)Updates the message with the specified entry ID.

Events

NameDescription
event ItemMovedOccurs when an item is moved to another folder.
event MessageAddedOccurs when a message is added to the folder.

Remarks

Get folders from a PersonalStorage: RootFolder, GetPredefinedFolder, GetFolderById, or the GetSubFolder and GetSubFolders methods of another folder. Methods that change a folder throw NotImplementedException for an ANSI PST and InvalidOperationException when the PST is open for reading only.

See Also