EwsDownloadItemIds Method (FolderId, Boolean)
Downloads IDs of all or unread items in the specified folder.

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


Type: FolderId
The ID of the folder. Null reference (Nothing in Visual Basic) not allowed.
Type: SystemBoolean
If true, only unread items are considered for download; otherwise, all the items.

Return Value

Type: EwsItemList
The list of EwsItem items with Id property set, 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.

You can use this method to get the list of all IDs in the folder. You can then use methods like DownloadItems(IEnumerableEwsItem, EwsItemParts) to get full items for the returned list (you can also process the returned list to make any subset from it or change sorting order, for instance, to implement paged output). You can also use MS Exchange's own mechanism of paging using ItemView objects with methods like DownloadItemIds(FolderId, ItemView, bool) or DownloadItems(FolderId, ItemView, bool, EwsItemParts).

Item string IDs (UniqueId value) can then be stored elsewhere, and you can later recreate EwsItem from that string using EwsItem(String) constructor.

Items are returned in the default sorting order which usually means "newer first" in Exchange. This is different from IMAP and POP3, where "older first" is the default.

Note Note
In the returned collection of EwsItem objects, you can access their Id and UniqueId properties only. Accessing other properties will cause an exception (because only ID was loaded for each item).
Note Note
This method is not implemented in .NET Core. Use DownloadItemIdsAsync(FolderId, Boolean) instead.
See Also