难倒了我们部门高手的简单问题
我在表单里做了一个按钮执行这个代理:
Sub Initialize
On Error Goto ErrorHandler
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim locationstr As String
Msgbox "enter"
Set db = session.CurrentDatabase
Set doc = session.DocumentContext
Call doc.Save(True,True)
Msgbox Cstr(doc.form(0))+Cstr(doc.UniversalID)
locationstr="./0/"+Cstr(doc.UniversalID)+"?opendocument"
Msgbox locationstr
Call writewin(|window.location.replace("|+locationstr+|")|)
Exit Sub
ErrorHandler:
alert("发生错误在"+Cstr(Erl)+"行,原因:"+Error)
End Sub
下面是代理中用到的方法用来改变当前表单窗口的路径.
Sub writewin(wstr As String)
JStr=|<SCRIPT>|
JStr=JStr+|function window.onerror(){|
JStr=JStr+|window.event.returnValue=true;|
JStr=JStr+|alert("脚本错误!")|
JStr=JStr+|;}|
JStr=JStr+wstr
JStr=JStr+|;</SCRIPT>|
Print JStr
End Sub
随便做一个表单,里面有个域,有个按钮.按扭的公式执行这个代理.为何不能打开这个已经存在后的文档.好象这个文档根本就没有保存.WHY?我们的部门高手帮我看时,头上直冒冷汗.WHY?