我想将数据库 A 中用户 san zhang/test 发和收的邮件全部筛选出来,拷贝放到另外一个数据库B里。
实现这样的效果,需要一小段 LotusScript 代码,有谁帮我写一下。
谢谢。
2009.11.08
------解决方案--------------------
Sub Initialize
Dim s As New notessession
'Change "" in the next line to the appropriate server name if the database is not local.
Dim srcdb As New notesdatabase("","e:\nsf\A.nsf")
Dim newdb As New notesdatabase("","e:\nsf\B.nsf")
Dim coll As notesdocumentcollection
Dim doc As notesdocument
username = ""
formular = "@contains(SendTo;username) | @contains(CopyTo;username) | @contains(BlindCopyTo;username)"
Set coll=srcdb.search(formular)
For i = 1 To coll.count
Set doc=coll.getnthdocument(i)
Call doc.copytodatabase(newdb)
Next
End Sub