我在一个文件夹中有一个文档,AUNID
其中的一个字段填充了特定子文档的唯一 ID。在文件夹的操作栏上,我有一个按钮,它应该打开与AUNID
用户编辑相关的文档。
当按下操作按钮时,它会给用户以下错误:
Invalid UNID; UNID must be a 32-digit hex string.
但是,在按下“确定”后,会打开正确的文档进行编辑。我已经使用了调试器,并且代码完全按照我的预期执行,但是这个错误似乎没有理由弹出。
这是我的代码:
Sub Click(Source As Button)
On Error Goto handleError
Dim ws As New NotesUIWorkspace
Dim s As New NotesSession
Dim leaddoc As NotesDocument
Dim action As NotesDocument
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesUIDocument
Set db = s.CurrentDatabase
Set leaddoc = db.UnprocessedDocuments.GetFirstDocument
Set view = db.GetView("(ActionsByLead)")
If (leaddoc.GetFirstItem("AUNID").Text = "") Then
Msgbox ("There is nothing to edit!")
Exit Sub
End If
Dim uid As String
uid = Cstr(leaddoc.GetFirstItem("AUNID").Text)
Set action = db.GetDocumentByUNID(uid)
Call ws.SetTargetFrame("")
Call ws.EditDocument(True, action,,,, False) 'Error occurs on this line according to the debugger.
Exit Sub
handleError:
Resume Next
End Sub