我想在按钮和代理中使用以下脚本库。
我的脚本库代码:验证
Option Public
Option Declare
Dim Sess As NotesSession
Dim currentDb As NotesDatabase
Dim dataDb As NotesDatabase
Dim doc As NotesDocument
Dim workspace As NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim rtitem As NotesRichTextItem
Sub Initialize
Set Sess = New NotesSession
Set currentDb = Sess.CurrentDataBase
Set workspace = New NotesUIWorkspace
Set uidoc = workspace.CurrentDocument
End Sub
Function ValidateForm ( Source As NotesUIDocument) As Boolean
On Error GoTo e
Set doc=source.Document
Dim Txt As String
Dim trimmed As string
txt = doc.Name(0)
trimmed = Trim(Txt)
If ( trimmed = "") Then
MsgBox "Please enter some text."
source.GotoField("Name")
ValidateForm= false
Else
ValidateForm= True
End If
Exit Function
e:
MsgBox "error at"& Erl() & " and error is "& Error()
End Function
在按钮中:
在按钮中,当我调用脚本库时,因为在 validateform 函数中它的源代码为 notesuidocument,并且在按钮单击中它的源代码为按钮,我给了我错误。
Sub Click(Source As Button)
End Sub
我尝试在以下选项中使用代理:
使用“验证”
并尝试使用公式 @Command([ToolsRunMacro]; "Val") 在按钮中调用它但没用,我没有得到所需的输出。我是莲花笔记的新手。请帮助我完成上述任务。