使用LotusScript获取多值域的值

原理:文档中的域值是数组形式的 。多值域的值类似于一行多列的数组,下标从0开始。
假定域名为Employee,类型为多值文本域,文档中此域的值为:james,robin,alfred。
计划使用LS的得到返回值为:jamesrobinalfred。
方法1、直接获取
strEmployee = doc.Employee(0) +doc.Employee(1) +doc.Employee(2)
方法2、使用Evaluate声明
Dim strEmployee As Variant
Const NotesMacro$ = "@Implode(Employee)"
strEmployee = Evaluate(NotesMacro$,doc)
Msgbox Cstr(strEmployee(0)) 
方法3、使用GetItemValue方法
 Dim itmEmployee As Variant
 itmEmployee = doc.GetItemValue("Employee ")
 Forall o In itmEmployee
  Msgbox Cstr(o)
 End Forall
方法4、转化为数组处理
Dim i,j As Integer
i = 0
arrEmployee = doc.GetItemValue("Employee ")
For j=Lbound(arrEmployee) To Ubound(arrEmployee)
 Msgbox Cstr(arrEmployee(i)) 
 i=i+1
Next  

posted @ 2009-09-08 15:17  风影极光  阅读(1023)  评论(0编辑  收藏  举报