急。。。怎么去循环读取视图里面的信息,把他的每个字段分别放到每个表单里面
Sub Click(Source As Button)Dim session As New NotesSession
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim db As NotesDatabase
Dim view As NotesView
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Set uidoc = ws.CurrentDocument
Set doc = uidoc.Document --得到当前文档
Set db=session.CurrentDatabase
Set view=db.GetView ("PillarInformation for MSEmbeded")--得到那个视图
Set dc = view.GetAllDocumentsByKey (doc.ContractNo(0))根据CountractNo去找
Set doc = dc.GetFirstDocument --得到第一个文档(里面有很多字段)
。
。接下来我该怎么去读里面的字段值,把他放到对应的别的表单里面
--------------------编程问答-------------------- Set doc = uidoc.Document --得到当前文档
Set doc = dc.GetFirstDocument --得到第一个文档(里面有很多字段)
先搞清楚逻辑再问问题吧,如果doc是当前文档,吧doc_tmp作为第一个文档赋值
doc.test = doc_tmp.test
doc.test1 = doc_tmp.test1
仅此而已,如果是其他的需求,有问才有答. --------------------编程问答-------------------- Sub Click(Source As Button)
Dim session As New NotesSession
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim db As NotesDatabase
Dim view As NotesView
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
dim tmpdoc as NotesDocument
Set uidoc = ws.CurrentDocument
Set doc = uidoc.Document --得到当前文档
Set db=session.CurrentDatabase
Set view=db.GetView ("PillarInformation for MSEmbeded")--得到那个视图
Set dc = view.GetAllDocumentsByKey (doc.ContractNo(0))根据CountractNo去找
Set doc = dc.GetFirstDocument --得到第一个文档(里面有很多字段)
While Not doc Is Nothing
set tmpdoc = db.CreateDocument()'创建一份文档
tmpdoc.Form = "fmTest" '指定表单名
tmpdoc.Test1 = doc.txTest1(0) '对文档中域进行赋值
call tmpdoc.Save(true,false)'保存文档
set doc = dc.GetNextDocument(doc)
Wend
'=================================================================
呵呵,希望对你有帮助
补充:企业软件 , Lotus