| 发表于:2007-06-20 15:54:594楼 得分:0 |
谢谢漂浮的云,不过你给的代码不能直接用,我又改了一下,然后对单个文档的时候我是这么写的: dim doc as notesdocument set doc=session.documentcontext forall i in doc.items if item.isreaders then set nam = new notesname( "b ") call i.appendtotextlist(cstr(nam.canonical)) call doc.save(true,false) end if end forall exit sub 果然是好的,没有问题。 但是,我又改了一下,因为我要取一组document,然后在reader域里面增加b的值,如下: dim session as new notessession dim db as notesdatabase dim collection as notesdocumentcollection dim doc as notesdocument set db = session.currentdatabase set collection = db.alldocuments dim dc as notesdocumentcollection dim view as notesview key = "a " set view = db.getview ( "dbsy " ) set dc = view.getalldocumentsbykey(key, false) set doc = dc.getfirstdocument() i=1 while not(doc is nothing) tt=evaluate( "@setfield( 'to ';to: 'b ') ",doc) forall i in doc.items if item.isreaders then set nam = new notesname( "b ") call item.appendtotextlist(cstr(nam.canonical)) end if end forall call doc.save(true, true ) set doc = dc.getnextdocument(doc) i=i+1 wend exit sub 但是运行的时候forall i in doc.items一行报错说no resume,不知道是不是我doc取的不对还是我少定义了什么呢? | | |
|