Set doc=collection.GetFirstDocument()
While Not(doc Is Nothing)
Forall o in Doc.Fs_Bm
If o = "Admin/XX大学" Then
REM QueryResult是一个文件夹
Call doc.PutInFolder("QueryResult",True)
REM 处理结束
Exit Forall
End If
End Forall
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim view As NotesView
Set db=session.CurrentDatabase
Set collection=db.AllDocuments
Set view=db.GetView("QueryResult")
REM 文件夹清空
Set doc=view.GetFirstDocument
While Not(doc Is Nothing)
Call doc.RemoveFromFolder("QueryResult")
Set doc=view.GetNextDocument(doc)
Wend
REM 文件夹完成
Set doc=collection.GetFirstDocument()
While Not(doc Is Nothing)
If Isarray(doc.GetItemValue("Fs_Bm"))=False Then
If doc.GetItemValue(0)="Admin/XX大学" Or doc.GetItemValue(0)="Admin/XX大学," Then
REM 处理
REM QueryResult是一个文件夹
Call doc.PutInFolder("QueryResult",True)
REM 处理结束
End If
End If
Set doc=collection.GetNextDocument(doc)
Wend
End Sub
这是我的代码:
------------------------------------------------
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim dc As NotesDocumentCollection
Set db = session.CurrentDatabase
Set view = db.GetView( "VieDeptSW" )
Set dc = view.GetAllDocumentsByKey("Admin/XX大学",True)
Call dc.PutAllInFolder("BMSW")
------------------------------------------------------
我没有理解您的意思:
"你可以遍历dc用doc.GetItemValue("")(0)="Admin/XX大学"来产生新的文档集"