方法一:db查询
Sub Initialize
On Error Goto a
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim dc As NotesDocumentCollection
Query = "Form='FormWeb_Test'" '查询条件
Set dc = db.Search(Query,Nothing,0) '在数据库中根据条件进行查询
Msgbox dc.Count
Exit Sub
a:
Msgbox "错误在代理sz_test中的第" & Erl & "行-------:" & Error
End Sub
方法二:View查询(注:该方法的查询条件是写在视图里的,代理获得到的是视图中直接过滤好的文档)
Sub InitializeOn Error Goto a
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim view As NotesView
Set view = db.GetView("视图名") '在数据库中获取视图
Dim vc As NotesViewEntryCollection '定义集合
Set vc = view.AllEntries
Msgbox vc.Count
Exit Sub
a:
Msgbox "错误在代理sz_test中的第" & Erl & "行-------:" & Error
End Sub