EwsDownloadItems Method (FolderId, ItemView, Boolean, PropertySet)
Downloads items in the specified folder in the specified ItemView range using PropertySet settings.

Namespace: MailBee.EwsMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.2.0 build 630 for .NET 4.5
public EwsItemList DownloadItems(
	FolderId id,
	ItemView view,
	bool unreadOnly,
	PropertySet properties


Type: FolderId
The ID of the folder. Null reference (Nothing in Visual Basic) not allowed.
Type: ItemView
The settings which specify how many items to download, offset, and sort ordering. If a null reference, all the matching items are downloaded and the sorting order is default (usually, "newer first").
Type: SystemBoolean
If true, only unread items are considered for download; otherwise, all the items.
Type: PropertySet
The settings which specify which portions of MS Exchange items to download (e.g. item ID, mail header, body, etc). If a null reference, only item ID is requested.

Return Value

Type: EwsItemList
The list of items in the given folder, or a null reference (Nothing in Visual Basic) on error.
MailBeeExceptionAn error occurred and ThrowExceptions is true.
NotImplementedExceptionThe .NET runtime is .NET Core.

To specify the folder by its name, first get its ID with FindFolderIdByShortName(FolderId, String) or FindFolderIdByFullName(String) method.

This overload lets you specify EWS's ItemView object to configure ordering and paging of the results. Alternatively, you can download all IDs of all items using DownloadItemIds(FolderId, Boolean) method and then use DownloadItems(IEnumerable<EwsItem>, EwsItemParts) overload to download the requested items.

You can also use DownloadItems(FolderId, int, int, bool, PropertySet) overload if you have a range of messages you want to download.

As for properties parameter, You can build PropertySet object manually or use CreatePropSet(EwsItemParts) method for this.

Note Note
view parameter (ItemView object) has its own PropertySet setting. It's not used by this method so it's recommended to leave the default value. If you need this value to be actually consumed, consider Search(FolderId, SearchFilter, ItemView) method instead.
Note Note
This method is not implemented in .NET Core. Use DownloadItemsAsync(FolderId, ItemView, Boolean, PropertySet) instead.
See Also