How to get list of views from “mail” in Lotus Notes using .NET?

删除回忆录丶 提交于 2019-12-01 14:20:45

There is a property of the NotesDatabase class called Views that will let you access all the views in the database. You could loop through them to access each view.

Also this open source class called DatabaseProperties can help you get a list of design documents, specifically the views in the database, and many more of the view's properties.

Preeti

Solution is:

Object[] docColl = _notesDatabase.Views as Object[];

foreach (Object objView in docColl) {  
   NotesView view = objView as NotesView;
   MessageBox.Show(view.Name);    
}

In VB.net, the basic code to get all views (and folders) and for each, to get all included documents, would look something like this:

Dim s As New notesSession
Dim db As notesDatabase
Set db = s.CurrentDatabase
Dim vws As Variant
vws = db.Views
Forall v In vws
    'New View being processed
    Dim doc As notesDocument
    Set doc = v.getFirstDocument()
    While Not (doc Is Nothing)
        ' do something for each document
        ' ....
        Set doc = v.getNextDocument(doc)
    Wend
End Forall
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!