How can i detect an outlook mail folder if it's hidden? RRS feed

  • Question

  • I have a list box, and i want to list email folders inside it. I create the data source like:

    Outlook.Folders folders =["my email address"].Folders;
    List<Outlook.Folder> folderSource = new List<Outlook.Folder>();
    foreach (Outlook.Folder folder in folders)
    if (folder.DefaultItemType == Outlook.OlItemType.olMailItem)

    But, it contains some other hidden folders such as "Sync Issues" etc. How can i filter those folders ? I tried to use folder.PropertyAccessor.GetProperty("")), however it gives error "The property "" is unknown or cannot be found."

    Tuesday, November 19, 2013 4:37 PM


  • "Sync Issues" folder is not hidden.

    If PR_ATTR_HIDDEN is not present, you should handle the exception and assume PR_ATTR_HIDDEN = false

    Dmitry Streblechenko (MVP)
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, November 19, 2013 4:48 PM