1.查找出查找内容在多值域中的索引值

getItemIndex(域名,域值,文档)

Public Function getItemIndex(ByVal fieldName As String, ByVal itemVal As Object, 
ByVal doctt As NotesDocument) As Integer
Dim i As Integer
Dim j As Integer
Dim item As NotesItem
item = doctt.GetFirstItem(fieldName)
j = Ubound(item.Values)
For i = 0 To j
If itemVal = item.Values(i) Then
getItemIndex = i
Exit Function
End If
Next
getItemIndex = -1
End Function

2.删除多值域中的数据
delItemValues(多值域名,更改的索引值,所在文档对象)

Public Sub delItemValues(ByVal fieldName As String, ByVal index As Integer, ByVal doctt As NotesDocument)
Dim i As Integer
Dim temp() As Object
Dim item As NotesItem
item = doctt.GetFirstItem(fieldName)
Dim j As Integer j = Ubound(item.values)
'-----------
If j = 0 Then
'当J为0时,即仅有一个值,给予空值即可
Call doctt.ReplaceItemValue(fieldName, "")
Exit Sub
End If
'------------
If Trim(item.Values(0)) = "" Then
index = j
End If
If index > j Then
'仍然做为最后一个数据加入
j = j + 1 '索引位仅增加1
index = j '重定义索引位,防止超出范围
End If Redim temp(j-1) As Variant '重定义数组
For i = 0 To index - 1
temp(i) = item.values(i)
Next For i = index To j - 1
temp(i) = item.values(i + 1)
Next Call doctt.ReplaceItemValue(fieldName, temp)
'End If
'End If
End Sub

3.更改多值域中的数据
editItemValues(多值域名,更改的索引值,更改的内容,所在文档对象)

Public Sub editItemValues(ByVal fieldName As String, ByVal index As Integer, ByVal itemVal As Object, 
ByVal doctt As NotesDocument)
Dim i As Integer
Dim temp() As Object
Dim item As NotesItem
item = doctt.GetFirstItem(fieldName)
Dim j As Integer j = Ubound(item.values)
If Trim(item.Values(0)) = "" Then
index = j
End If
If index > j Then
'仍然做为最后一个数据加入
j = j + 1 '索引位仅增加1
index = j '重定义索引位,防止超出范围
End If Redim temp(j) As Variant '重定义数组 For i = 0 To j
If i = index Then
temp(i) = itemVal
Else
temp(i) = item.values(i)
End If
Next
Call doctt.ReplaceItemValue(fieldName, temp)
'End If
'End If
End Sub

最新文章

  1. ios 获取手机的IP地址
  2. Windows系统盘占用空间分析
  3. android SDK 离线下载更新
  4. Objective-C 快速入门--基础(一)
  5. 16 款最流行的 JavaScript 框架
  6. Scrum 3.1 多鱼点餐系统开发进度(第三阶段项目构思与任务规划)
  7. C# this指针用法
  8. 记一次apt-get无法安装git的问题
  9. Delphi - 在ListView中添加一个进度条
  10. 硬盘安装ubuntu
  11. Linux编程---套接字
  12. 20个常用的Java程序块
  13. 【annotation】非人类物种基因组注释(MSU为例)
  14. python学习-迭代器,列表解析和列表生成式
  15. 让java从Mysql返回多个ResultSet
  16. Leading and Trailing(数论/n^k的前三位)题解
  17. URL编码分析与乱码解决方案
  18. Android 如何将Canvas上绘制的内容保存成本地图片(转)
  19. MYSQL在Win下免安装zip
  20. python标准库介绍——7 cmath 模块详解

热门文章

  1. 遍历DOM树
  2. myeclipse启动错误:org.eclipse.swt.SWTError: No more handles
  3. ERP合同列表页面自动导航(三十二)
  4. hdu 1025 上面n个点与下面n个点对应连线 求最多能连有多少条不相交的线 (LIS)
  5. 使用共同函数,将PNotify弹出提示框公用
  6. Spring Boot自动扫描
  7. 【算法】后缀自动机(SAM) 例题
  8. 【noip模拟赛4】找啊找啊找BF 拓扑排序
  9. 【Java】 剑指offer(53-2) 0到n-1中缺失的数字
  10. 085 HBase的二级索引,以及phoenix的安装(需再做一次)