none
Way to gather all folders by specified crieria in one shot RRS feed

  • Question

  • I would like to get all folders (entrieids would be sufficient) based on value of some property in as little calls as possible.

    Problem:

    each folder can have specific word in its description field (PR_COMMENT). Currently i iterate through each folder and recursivly check its Folders property to gather all folders that match my criteria. I tried using Redemption and MAPITable.ExecuteSQL like

    SELECT EntryID FROM Folders WHERE \"http://schemas.microsoft.com/mapi/proptag/0x3004001F\" LIKE...

    but of course it solves nothing because i still have to iterate each folder and check its subfolders.

    Does anyone have better idea?

    Thursday, March 1, 2012 12:57 PM

Answers

  • No, now that I think more about it more the results would be items and not based on folder properties. Even advanced search would present those problems. I think you're stuck with folder by folder processing.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "DamianD" <=?utf-8?B?RGFtaWFuRA==?=> wrote in message news:c9c383a9-6527-4cbd-8d36-360e792aadb9...
    Can i search by properties of folder itself, not items stored in it? (will i get results that are not items but folders themselves)

    Ken Slovak MVP - Outlook
    • Marked as answer by DamianD Thursday, March 1, 2012 9:35 PM
    Thursday, March 1, 2012 4:22 PM
    Moderator

All replies

  • The problem with a table of course is that it is folder by folder. Have you looked at possibly using an Advanced Search, that could be store-wide? What are you actually searching for?

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "DamianD" <=?utf-8?B?RGFtaWFuRA==?=> wrote in message news:d66ad143-0ce8-46bd-b05c-8ef72144fa00...

    I would like to get all folders (entrieids would be sufficient) based on value of some property in as little calls as possible.

    Problem:

    each folder can have specific word in its description field (PR_COMMENT). Currently i iterate through each folder and recursivly check its Folders property to gather all folders that match my criteria. I tried using Redemption and MAPITable.ExecuteSQL like

    SELECT EntryID FROM Folders WHERE \"http://schemas.microsoft.com/mapi/proptag/0x3004001F\" LIKE...

    but of course it solves nothing because i still have to iterate each folder and check its subfolders.

    Does anyone have better idea?


    Ken Slovak MVP - Outlook
    Thursday, March 1, 2012 3:11 PM
    Moderator
  • i;m looking for a specific word in comments of folder, by which i will know that i need to process contents of that folder. Advanced search is a little bit to heavy, even with few hundreds of folders i guess i will still be faster with manual iteration. I was just wandering if there is maybe single MAPI table that contains entries for all folders in store.
    Thursday, March 1, 2012 3:25 PM
  • No, unfortunately there isn't a "universal" table of that kind. Don't forget, what we're dealing with here is a modified JET database and each folder is just another linked table under the hood.
     
    I don't know about Advanced Search being too heavy a lift, even if there are lots of folders it can run pretty quickly. Or you can go lower-level and use RDO and set up a MAPI restriction for a search folder, that's how they do Reminders or the ToDo Bar and other such cross-folder searches.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "DamianD" <=?utf-8?B?RGFtaWFuRA==?=> wrote in message news:63086bb3-8050-4534-9545-1a7eec497c62...
    i;m looking for a specific word in comments of folder, by which i will know that i need to process contents of that folder. Advanced search is a little bit to heavy, even with few hundreds of folders i guess i will still be faster with manual iteration. I was just wandering if there is maybe single MAPI table that contains entries for all folders in store.

    Ken Slovak MVP - Outlook
    Thursday, March 1, 2012 3:50 PM
    Moderator
  • Can i search by properties of folder itself, not items stored in it? (will i get results that are not items but folders themselves)
    Thursday, March 1, 2012 3:58 PM
  • No, now that I think more about it more the results would be items and not based on folder properties. Even advanced search would present those problems. I think you're stuck with folder by folder processing.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "DamianD" <=?utf-8?B?RGFtaWFuRA==?=> wrote in message news:c9c383a9-6527-4cbd-8d36-360e792aadb9...
    Can i search by properties of folder itself, not items stored in it? (will i get results that are not items but folders themselves)

    Ken Slovak MVP - Outlook
    • Marked as answer by DamianD Thursday, March 1, 2012 9:35 PM
    Thursday, March 1, 2012 4:22 PM
    Moderator