Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Programmatically "Show all documents without folders"

  Asked By: Tyler    Date: Dec 17    Category: Sharepoint    Views: 2353

I'm trying to programmatically create views against all our existing
document libraries that mirror what you would get if you selected "Show
all documents without folders" when editing a view through the UI.

Everything works fine apart from this, I just can't find a way of
setting it.
Any ideas?



3 Answers Found

Answer #1    Answered By: Eliza Hutchinson     Answered On: Dec 17

You need to set a property on your query, if I remember correctly (long shot
on a Sunday) it's called 'Recursive'. If you can't find  it, I'll check my
code tomorrow when I get back to work, I ran into this same problem and it
wasn't as obvious as I expected it to be

Answer #2    Answered By: Lesley Tate     Answered On: Dec 17

Ok, my memory wasn't quite there, here's the statement to add to your query
object to enable searching through all folders:

queryObj.ViewAttributes = "Scope='Recursive'";

Didn't find what you were looking for? Find more on Programmatically "Show all documents without folders" Or get search suggestion and latest updates.