2017-01-30 35 views
0

我需要帮助,我需要知道如何获取表单字段的值 我知道如何获取字段名称,但不知道其中的值。 .. 这里是我的代码的树干版本: 顺便说一下,循环现在没有任何意义,但它会正确使用,一旦我找到了如何获得字段值,... 谢谢大家!获取Lotus Notes表单中字段的值

Forall field In form.Fields  
    fieldCount = fieldCount + 1 
    msgString = msgString & Chr(10) & "  " & field 

    If (field Like "*Act*") Then   
     ActfieldCount = ActfieldCount + 1 

     If (field Like "RNomAct1") Then 
      Msgbox("RNomAct1 found in SourceString!") 
'thoses do not work    

'    test = field.GetItemValue("RNomAct1") 
'    test = field.FieldGetText("RNomAct1") 
'    Messagebox(test(0)) 

     End If 
    Else 
     Msgbox("Could not find the SearchString.") 
    End If 

End Forall 

回答

0

某处你应该有一个文档的引用。或者,如果你没有,你可以通过一些其他对象访问当前文档:

Dim ws as New NotesUIWorkspace 
Dim uidoc as NotesUIDocument 
Set uidoc = ws.CurrentDocument 

然后你就可以用这个电话获取字段值:

uidoc.FieldGetText("name-of-field-here") 
+0

感谢的我有一些搜索得到它太,我真的是Lotus Notes中的新成员(并且与Documents UIDoc的概念非常混淆......) –