Follow up to my prior post where Denny commented that he wants the @WhichFolders available in Lotusscript. Well, back in March 2008, Bob Balaban blogged about a routine to find what folder a document is in. He blogged a code snippet that was written in C#. An alternative or two, and the timing of the various methods were blogged by Steve McDonagh, so check that out.
Here is my little snippet of the same basic idea as Bob’s, but in Lotusscript. The v.IsFolder bit is a little slow. And obviously, the more folders you have the longer this will take. @WhichFolders is much faster, but doesn’t work outside of view columns!
Dim ses As New NotesSession Dim db As NotesDatabase Dim myViews As Variant Dim myFolders As Variant Set db = ses.CurrentDatabase Dim doccol As NotesDocumentCollection Dim doc As NotesDocument Set doccol = db.UnprocessedDocuments Set doc = doccol.GetFirstDocument() myViews = db.Views Dim viewnav As NotesViewNavigator While Not (doc Is Nothing) ForAll v In myViews If v.IsFolder Then v.AutoUpdate = False Set viewnav = v.CreateViewNavFrom(doc) If viewnav.Count > 0 Then MessageBox v.name End If End If End ForAll Set doc = doccol.Getnextdocument(doc) Wend
ls2html was brought to you by nsftools.com