0
votes

In Exchange 365, there is now the ability to archive an email after you have read it.

enter image description here

Once you click the 'Archive' button the email is moved out of the users Inbox into an Archive folder.

I am trying to access the mails in this Archive folder using EWS but have not had any luck.

The Archive folder does not appear in the WellKnownFolderName enum. The closest options ArchiveRoot or ArchiveMsgFolderRoot generate an error when I try to access them

{"The specified folder could not be found in the store."}   System.Exception {Microsoft.Exchange.WebServices.Data.ServiceResponseException}

The 'In-Place Archive' feature is disabled for this mailbox in the Exchange Admin area.

I have also tried to EWS AutodiscoverService Service to find any alternative mailboxes assigned to the target user but no mailboxes are returned.

Can someone please outline how I can use EWS to read mails from this Archive Folder?

1

1 Answers

4
votes

The folder is your screenshot is just a normal Mailbox Folder (user created) so you would need to find that folder eg something like

        FindFoldersResults aFolders = service.FindFolders(WellKnownFolderName.MsgFolderRoot,new SearchFilter.IsEqualTo(FolderSchema.DisplayName,"Archive"), new FolderView(1));
        if(aFolders.Folders.Count == 1){

        }

Should work okay. The actual feature your using in this instance is called One-Click Archive https://blogs.office.com/2015/08/04/new-features-coming-to-outlook-on-the-web/ (its just a move so not a true a archive in the conventional sense unless the some other process hooked to the folder

ArchiveRoot or ArchiveMsgFolderRoot are of the InPlace Archive

Cheers Glen