老兄,你要求的文档标记已读是何意思,是不是在再视图显示里将他归类到已读分类中(对应的为未读分类)?
如是这样的话,可以参考一下:
................
Dim j As Integer
Dim i As Integer
j=0
Set db = s.getdatabase("","d:/被拷的数据库名")
Set ndb=s.getdatabase("server","目录/要拷到的目的数据库名")
Set view = ndb.getview("视图名")
Set doc = view.getfirstdocument()
While Not doc Is Nothing
Set ndoc = doc.copytodatabase(db)
'拷贝附件
If doc.fj(0)<>"" Then
Dim Pdoc As notesdocument
Set Pdoc = ndb.Getdocumentbyunid(doc.PID(0))
Set rtfitem=New notesrichtextitem(ndoc,"zqyjfj")
If Not PDoc Is Nothing Then
Forall o In Pdoc.items
If o.Name="$FILE" Then
Set neo=Pdoc.getattachment(o.Values(0))
Call neo.extractfile("d:\tmp\"+o.Values(0))
Call rtfitem.EmbedObject(EMBED_ATTACHMENT,"","d:\tmp\"+o.Values(0))
Kill "d:\tmp\"+o.Values(0) '存放附件的文件夹
End If
End Forall
End If
End If
Call ndoc.save(True,False)
Call doc.save(True,False)