1 如何遍历当前数据库视图的所有文档
///////////////////////////////////////////////////
Dim entrydc As NotesViewEntryCollection
Dim entry As NotesViewEntry
Set entrydc=view.AllEntries
If entrydc.Count =0 Then
Exit Sub
End If
while not entry is nothing
Set entry=entrydc.GetFirstEntry
Set doc=entry.Document
Set entry=entrydc.GetNextEntry(entry)
wend
////////////////////////////////////////
2 删除当前视图中选中的文档
Dim wk As New NotesUIWorkspace
Dim session As New NotesSession
Dim uiview As NotesUIView
Dim doc As NotesDocument
Dim db As NotesDatabase
Dim view As NotesView
Set uiview =wk.CurrentView
Set db=session.CurrentDatabase
Set view=db.GetView("viewJgbs")
If uiview.Documents.Count >0 Then
For j=1 To uiview.Documents.Count
Set doc=uiview.Documents.GetNthDocument(j)
doc.Remove(True)
Next
wk.ViewRefresh
Else
Exit Sub
End If
////////////////////////////
3 清空当前数据库的活动视图中的数据
//////////////////////////////////
Dim entrydc As notesviewentrycollection
dim entry as notesiviewEntry
set entrydc =view.allentrys
set entry=entry.getfirstEntry
if not entry is nothing then
entrydc.removeall(true)
end if
wk.ViewRefresh
//////////////////////////