I am getting contents of all views (Folders).Like Inbox,Calendar,ToDo e.t.c.
As mentioned in Title i want to access contents of Folders created my user.
For Example "Folder1" and sub-folder "ABC"
I can do it as:
NotesView folder = _notesDatabase.GetView("(Folder1)");
NotesDocument docFolder = folder.GetFirstDocument();
For sub-folder : NotesView folder = _notesDatabase.GetView("(Folder1/ABC)");
But here i need to specify folder name.Which can't be known in advance.
So i can't hard code it.
Is there any way to get only list of User created Folders and Sub-folders?
Best Answer
To iterate over all folders in a mailbox, use
NotesDatabase.Views
and theisFolder
property. Then you can either explicitly exclude ($Inbox), ($Junkmail) et.c. or use the heuristic that folders where the name begins with "(" are system folders:Ken Pespisas suggestion to use
isPrivate
is nicer and will work unless users are allowed to create shared folders. I'm not sure if this is the default Notes access or not.