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: 11.2.0 build 590 for .NET 4.5
Syntax
public EwsItemList DownloadItemIds(
	FolderId id,
	bool unreadOnly
)

Parameters

id
Type: FolderId
The ID of the folder. Null reference (Nothing in Visual Basic) not allowed.
unreadOnly
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.
Exceptions
ExceptionCondition
MailBeeExceptionAn error occurred and ThrowExceptions is true.
Remarks

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).
See Also