PDA

View Full Version : Notes问题 C/S 的 ,很急!


pqhkrg4jfw
21-02-06, 04:46 PM
我现在新建一个文档,并且保存好了,之后需要写一份新的文档,内容和前面的差不多,

有没有办法,我直接打开写过的那份文档,在上面修改好了以后,重新发布成新的,而不是覆盖原来的?

请问如何实现?

表单都是用的同一个,是否可以在表单上加个按钮为:重新发布,那么怎么写事件中的代码????

空空空
21-02-06, 06:30 PM
很简单,在重新发布的的Click事件中写相应的代码,代码的功能是:
1.新建一份文档,并保存

Set docNew as NotesDocument(db)
call doc.CopyAllItems(docNew,True)
call docNew.Save(True,False)

2.关闭现在打开的文档(不要保存)

call udoc.Close()


结合这两点,可以写这样的代码:

Dim uws As New NotesUIWorkspace
Dim udoc As NotesUIDocument
Dim doc As NotesDocument
Dim db As NotesDatabase
Dim docNew As NotesDocument

Set udoc = uws.CurrentDocument
Set doc = udoc.Document
Set db = doc.ParentDatabase

Set docNew = New NotesDocument(db)
Call doc.CopyAllItems(docNew,True)
Call docNew.Save(True,False)

doc.SaveOptions = "0"
Call udoc.Close()
Call uws.ViewRefresh()