Table of Contents

Class Folder

Namespace
Microsoft.Exchange.WebServices.Data
Assembly
Microsoft.Exchange.WebServices.dll

Represents a generic folder.

public class Folder : ServiceObject
Inheritance
Folder
Derived
Inherited Members

Constructors

Folder(ExchangeService)

Initializes an unsaved local instance of Folder. To bind to an existing folder, use Folder.Bind() instead.

public Folder(ExchangeService service)

Parameters

service ExchangeService

EWS service to which this object belongs.

Properties

ArchiveTag

Gets or sets the archive tag.

public ArchiveTag ArchiveTag { get; set; }

Property Value

ArchiveTag

ChildFolderCount

Gets the number of child folders this folder has.

public int ChildFolderCount { get; }

Property Value

int

DisplayName

Gets or sets the display name of the folder.

public string DisplayName { get; set; }

Property Value

string

EffectiveRights

Gets a value indicating the effective rights the current authenticated user has on the folder.

public EffectiveRights EffectiveRights { get; }

Property Value

EffectiveRights

ExtendedProperties

Gets a list of extended properties associated with the folder.

public ExtendedPropertyCollection ExtendedProperties { get; }

Property Value

ExtendedPropertyCollection

FolderClass

Gets or sets the custom class name of this folder.

public string FolderClass { get; set; }

Property Value

string

Id

Gets the Id of the folder.

public FolderId Id { get; }

Property Value

FolderId

ManagedFolderInformation

Gets the Email Lifecycle Management (ELC) information associated with the folder.

public ManagedFolderInformation ManagedFolderInformation { get; }

Property Value

ManagedFolderInformation

ParentFolderId

Gets the Id of this folder's parent folder.

public FolderId ParentFolderId { get; }

Property Value

FolderId

Permissions

Gets a list of permissions for the folder.

public FolderPermissionCollection Permissions { get; }

Property Value

FolderPermissionCollection

PolicyTag

Gets or sets the policy tag.

public PolicyTag PolicyTag { get; set; }

Property Value

PolicyTag

TotalCount

Gets the total number of items contained in the folder.

public int TotalCount { get; }

Property Value

int

UnreadCount

Gets the number of unread items in the folder.

public int UnreadCount { get; }

Property Value

int

WellKnownFolderName

Gets the name of the well known folder.

public WellKnownFolderName? WellKnownFolderName { get; }

Property Value

WellKnownFolderName?

The name of the well known folder.

Methods

Bind(ExchangeService, FolderId)

Binds to an existing folder, whatever its actual type is, and loads its first class properties. Calling this method results in a call to EWS.

public static Folder Bind(ExchangeService service, FolderId id)

Parameters

service ExchangeService

The service to use to bind to the folder.

id FolderId

The Id of the folder to bind to.

Returns

Folder

A Folder instance representing the folder corresponding to the specified Id.

Bind(ExchangeService, FolderId, PropertySet)

Binds to an existing folder, whatever its actual type is, and loads the specified set of properties. Calling this method results in a call to EWS.

public static Folder Bind(ExchangeService service, FolderId id, PropertySet propertySet)

Parameters

service ExchangeService

The service to use to bind to the folder.

id FolderId

The Id of the folder to bind to.

propertySet PropertySet

The set of properties to load.

Returns

Folder

A Folder instance representing the folder corresponding to the specified Id.

Bind(ExchangeService, WellKnownFolderName)

Binds to an existing folder, whatever its actual type is, and loads its first class properties. Calling this method results in a call to EWS.

public static Folder Bind(ExchangeService service, WellKnownFolderName name)

Parameters

service ExchangeService

The service to use to bind to the folder.

name WellKnownFolderName

The name of the folder to bind to.

Returns

Folder

A Folder instance representing the folder with the specified name.

Bind(ExchangeService, WellKnownFolderName, PropertySet)

Binds to an existing folder, whatever its actual type is, and loads the specified set of properties. Calling this method results in a call to EWS.

public static Folder Bind(ExchangeService service, WellKnownFolderName name, PropertySet propertySet)

Parameters

service ExchangeService

The service to use to bind to the folder.

name WellKnownFolderName

The name of the folder to bind to.

propertySet PropertySet

The set of properties to load.

Returns

Folder

A Folder instance representing the folder with the specified name.

Copy(FolderId)

Copies this folder into a specific folder. Calling this method results in a call to EWS.

public Folder Copy(FolderId destinationFolderId)

Parameters

destinationFolderId FolderId

The Id of the folder in which to copy this folder.

Returns

Folder

A Folder representing the copy of this folder.

Copy(WellKnownFolderName)

Copies this folder into the specified folder. Calling this method results in a call to EWS.

public Folder Copy(WellKnownFolderName destinationFolderName)

Parameters

destinationFolderName WellKnownFolderName

The name of the folder in which to copy this folder.

Returns

Folder

A Folder representing the copy of this folder.

Delete(DeleteMode)

Deletes the folder. Calling this method results in a call to EWS.

public void Delete(DeleteMode deleteMode)

Parameters

deleteMode DeleteMode

Deletion mode.

Empty(DeleteMode, bool)

Empties the folder. Calling this method results in a call to EWS.

public void Empty(DeleteMode deleteMode, bool deleteSubFolders)

Parameters

deleteMode DeleteMode

The deletion mode.

deleteSubFolders bool

Indicates whether sub-folders should also be deleted.

FindFolders(FolderView)

Obtains a list of folders by searching the sub-folders of this folder. Calling this method results in a call to EWS.

public FindFoldersResults FindFolders(FolderView view)

Parameters

view FolderView

The view controlling the number of folders returned.

Returns

FindFoldersResults

An object representing the results of the search operation.

FindFolders(SearchFilter, FolderView)

Obtains a list of folders by searching the sub-folders of this folder. Calling this method results in a call to EWS.

public FindFoldersResults FindFolders(SearchFilter searchFilter, FolderView view)

Parameters

searchFilter SearchFilter

The search filter. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection

view FolderView

The view controlling the number of folders returned.

Returns

FindFoldersResults

An object representing the results of the search operation.

FindItems(ItemView)

Obtains a list of items by searching the contents of this folder. Calling this method results in a call to EWS.

public FindItemsResults<Item> FindItems(ItemView view)

Parameters

view ItemView

The view controlling the number of items returned.

Returns

FindItemsResults<Item>

An object representing the results of the search operation.

FindItems(ItemView, Grouping)

Obtains a grouped list of items by searching the contents of this folder. Calling this method results in a call to EWS.

public GroupedFindItemsResults<Item> FindItems(ItemView view, Grouping groupBy)

Parameters

view ItemView

The view controlling the number of items returned.

groupBy Grouping

The grouping criteria.

Returns

GroupedFindItemsResults<Item>

A collection of grouped items representing the contents of this folder.

FindItems(SearchFilter, ItemView)

Obtains a list of items by searching the contents of this folder. Calling this method results in a call to EWS.

public FindItemsResults<Item> FindItems(SearchFilter searchFilter, ItemView view)

Parameters

searchFilter SearchFilter

The search filter. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection

view ItemView

The view controlling the number of items returned.

Returns

FindItemsResults<Item>

An object representing the results of the search operation.

FindItems(SearchFilter, ItemView, Grouping)

Obtains a grouped list of items by searching the contents of this folder. Calling this method results in a call to EWS.

public GroupedFindItemsResults<Item> FindItems(SearchFilter searchFilter, ItemView view, Grouping groupBy)

Parameters

searchFilter SearchFilter

The search filter. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection

view ItemView

The view controlling the number of items returned.

groupBy Grouping

The grouping criteria.

Returns

GroupedFindItemsResults<Item>

A collection of grouped items representing the contents of this folder.

FindItems(string, ItemView)

Obtains a list of items by searching the contents of this folder. Calling this method results in a call to EWS.

public FindItemsResults<Item> FindItems(string queryString, ItemView view)

Parameters

queryString string

query string to be used for indexed search

view ItemView

The view controlling the number of items returned.

Returns

FindItemsResults<Item>

An object representing the results of the search operation.

FindItems(string, ItemView, Grouping)

Obtains a grouped list of items by searching the contents of this folder. Calling this method results in a call to EWS.

public GroupedFindItemsResults<Item> FindItems(string queryString, ItemView view, Grouping groupBy)

Parameters

queryString string

query string to be used for indexed search

view ItemView

The view controlling the number of items returned.

groupBy Grouping

The grouping criteria.

Returns

GroupedFindItemsResults<Item>

A collection of grouped items representing the contents of this folder.

MarkAllItemsAsRead(bool)

Marks all items in folder as read. Calling this method results in a call to EWS.

public void MarkAllItemsAsRead(bool suppressReadReceipts)

Parameters

suppressReadReceipts bool

If true, suppress sending read receipts for items.

MarkAllItemsAsUnread(bool)

Marks all items in folder as read. Calling this method results in a call to EWS.

public void MarkAllItemsAsUnread(bool suppressReadReceipts)

Parameters

suppressReadReceipts bool

If true, suppress sending read receipts for items.

Move(FolderId)

Moves this folder to a specific folder. Calling this method results in a call to EWS.

public Folder Move(FolderId destinationFolderId)

Parameters

destinationFolderId FolderId

The Id of the folder in which to move this folder.

Returns

Folder

A new folder representing this folder in its new location. After Move completes, this folder does not exist anymore.

Move(WellKnownFolderName)

Moves this folder to the specified folder. Calling this method results in a call to EWS.

public Folder Move(WellKnownFolderName destinationFolderName)

Parameters

destinationFolderName WellKnownFolderName

The name of the folder in which to move this folder.

Returns

Folder

A new folder representing this folder in its new location. After Move completes, this folder does not exist anymore.

RemoveExtendedProperty(ExtendedPropertyDefinition)

Removes an extended property.

public bool RemoveExtendedProperty(ExtendedPropertyDefinition extendedPropertyDefinition)

Parameters

extendedPropertyDefinition ExtendedPropertyDefinition

The extended property definition.

Returns

bool

True if property was removed.

Save(FolderId)

Saves this folder in a specific folder. Calling this method results in a call to EWS.

public void Save(FolderId parentFolderId)

Parameters

parentFolderId FolderId

The Id of the folder in which to save this folder.

Save(WellKnownFolderName)

Saves this folder in a specific folder. Calling this method results in a call to EWS.

public void Save(WellKnownFolderName parentFolderName)

Parameters

parentFolderName WellKnownFolderName

The name of the folder in which to save this folder.

SetExtendedProperty(ExtendedPropertyDefinition, object)

Sets the extended property.

public void SetExtendedProperty(ExtendedPropertyDefinition extendedPropertyDefinition, object value)

Parameters

extendedPropertyDefinition ExtendedPropertyDefinition

The extended property definition.

value object

The value.

Update()

Applies the local changes that have been made to this folder. Calling this method results in a call to EWS.

public void Update()