[EWS] Accessing Flagged Items and Tasks RRS feed

  • Question

  • In OWA and Office 365, I can "flag" an email, and it then appears in the folder "Flagged Items and Tasks".  I would like to use EWS (direct XML, not the managed API) to read these items.   However, when I use "FindFolder Traversal=Deep" to get a list of my EWS folders, "Flagged Items and Tasks" is not among them.  I do have the normal "Tasks" folder, but the flagged item is not there, only normal tasks.  Am I doing something wrong, or is there no way to retrieve flagged emails?

    Jeffrey McKay

    Monday, August 27, 2012 10:20 PM

All replies

  • This folder is a Search folder called "To-Do Search" and it located under the NON_IPM_Subtree so if you do a search from the Root rather then MSGRoot you should be able to find it eg

      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="" xmlns:m="" xmlns:t="http://sc" xmlns:soap="http://schemas.xml">
          <t:RequestServerVersion Version="Exchange2010_SP2" />
          <m:FindFolder Traversal="Shallow">
            <m:IndexedPageFolderView MaxEntriesReturned="1" Offset="0" BasePoint="Be
    ginning" />
                <t:FieldURI FieldURI="folder:DisplayName" />
                  <t:Constant Value="To-Do Search" />
              <t:DistinguishedFolderId Id="root" />

    The other way of getting the Id is to use the PidTagAdditionalRenEntryIdsEx extended property on the Root Folder. I would suggest having a look at the format using a Mapi editor like OutlookSpy or MFCMapi.


    Tuesday, August 28, 2012 2:52 AM
  • Hey Glen,

    Do you know if I this search folder supports these things:

    - Search exclusively for tasks, or exclusively emails or contacts that were flagged ?

    - Search for changes since a certain date, or a certain substitution ID (to only get the delta of changes when keeping this folder in sync).


    Friday, November 16, 2012 10:46 PM
  • A Search Folder is already a Restriction (a permanent one) so if you where to search on top of this restriction your putting a dynamic restriction on a permanent restriction which is supported but your millage may vary if your searches are really complex. You may be better just grabbing all the Items in the search folder (I don't think you every get a large volume of Items) then filter them at the client side which I'm sure would be faster, more reliable and easier on the Exchange Store then trying to pile a search on top (if its a simple search on a Indexed property its probably not that big a deal). Its something you need to test and see what works the best.


    Monday, November 19, 2012 5:51 AM