|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
我想从一个文档中取出一个server的名称,然后在现在的数据库中找出一年前的文档copy到那个server的一个数据库中。我这里没有server,没有办法试,也是第一次用copytodatabase这个方法,各位能不能帮我看看这段程序对不对啊。多谢了。
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As Notesdatabase
Set db=session.CurrentDatabase
Dim view As NotesView
Dim doc,doc1 As Notesdocument
Set view = db.GetView("Archive Server")
Set doc=view.GetFirstDocument
Dim serverna, Yforqplan As Variant
Dim m,yr As String
Dim x,y As String
yr=Year(Today)
serverna=""
While Not (doc Is Nothing)
serverna = doc.GetItemValue("archiveservername")
Set doc = view.GetNextDocument(doc)
Wend
Dim archivedb As New NotesDatabase(serverna,"Archive Tool v1.1.nsf")
Set view = db.GetView("Quarterly Plan")
Set doc=view.GetFirstDocument
While Not (doc Is Nothing)
Set doc1=view.GetNextDocument(doc)
Yforqplan = doc.GetItemValue("yearquarter")
y=Yforqplan(0)
x=Left$(y,4)
'Messagebox x
If Cint(x) = Cint(yr)-1 Then
Call doc.CopyToDatabase(archivedb)
Call doc.Remove(True)
End If
Set doc = doc1
Wend
End Sub
|
|