I can search items in Inbox as following with a filter using EWS manage api .
static void SearchByUsingFastSearch(ExchangeService service)
{
// Return the first 10 items in this call.
ItemView view = new ItemView(10);
// Find all items where the body contains "move reports".
string qstring = "Body:\"move reports\"";
// Identify the item properties to return.
view.PropertySet = new PropertySet(BasePropertySet.IdOnly,
ItemSchema.Subject);
// Send the request and get the results.
FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox, qstring, view);
}
in the same way , is there a way to find items in Clutter folder ?something like
FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Clutter, qstring, view);
There isn't an Enumerator for the Clutter folder since it was recently introduced for office365 online, with that being said to fix your problem you need to look for the folder by name, capture the id ( and save it to an instance variable, for subsequent uses ), and then look for items in it.
Ex.
ExtendedPropertyDefinition ClutterFolderEntryId = new ExtendedPropertyDefinition(new Guid("{23239608-685D-4732-9C55-4C95CB4E8E33}"), "ClutterFolderEntryId", MapiPropertyType.Binary);
PropertySet iiips = new PropertySet();
iiips.Add(ClutterFolderEntryId);
String MailboxName = "jcool@domain.com";
FolderId FolderRootId = new FolderId(WellKnownFolderName.Root, MailboxName);
Folder FolderRoot = Folder.Bind(service, FolderRootId, iiips);
Byte[] FolderIdVal = null;
if (FolderRoot.TryGetProperty(ClutterFolderEntryId, out FolderIdVal))
{
AlternateId aiId = new AlternateId(IdFormat.HexEntryId, BitConverter.ToString(FolderIdVal).Replace("-", ""), MailboxName);
AlternateId ConvertedId = (AlternateId)service.ConvertId(aiId, IdFormat.EwsId);
Folder ClutterFolder = Folder.Bind(service, new FolderId(ConvertedId.UniqueId));
Console.WriteLine("Unread Email in clutter : " + ClutterFolder.UnreadCount);
}
Source: http://gsexdev.blogspot.com/2015/01/accessing-clutter-folder-in-ews-in.html
@GlenScales