1. Find the index value of the search content in the multi-value range.
Getitemindex (domain name, Domain value, document)
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. delete data from multi-Value Domains
Delitemvalues (multi-value domain name, changed index value, Document Object)
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 'If J is 0, that is, there is only one value. Just give it a null value. Call Doctt. replaceitemvalue (fieldname, "" ) Exit sub end if '------------ If Trim (item. Values (0) = "" Then Index = J End if Index> J Then 'Still add as the last data J = J + 1 'Index bit only increases by 1 Index = J'Redefine the index bit to prevent exceeding the range End if redim Temp (J-1) As Variant 'Redefinition Array For I = 0 To Index-1 temp (I) = item. Values (I) Next I = index To J-1 temp (I) = item. Values (I + 1) Next call Doctt. replaceitemvalue (fieldname, temp) 'End if' end if End sub
3. Change Data in a multi-value domain
Edititemvalues (multi-value domain name, changed index value, changed content, Document Object)
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 Index> J Then 'Still add as the last data J = J + 1 'Index bit only increases by 1 Index = J 'Redefine the index bit to prevent exceeding the range End if redim Temp (j)As Variant 'Redefinition Array 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. Find the index value of the search content in the multi-value range.
Getitemindex (domain name, Domain value, document)
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 = 0To J If Itemval = item. Values (I) Then Getitemindex = I Exit function end if next Getitemindex =-1 End Function
2. delete data from multi-Value Domains
Delitemvalues (multi-value domain name, changed index value, Document Object)
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 'If J is 0, that is, there is only one value. Just give it a null value. Call Doctt. replaceitemvalue (fieldname,"" ) Exit sub end if '------------ If Trim (item. Values (0) = "" Then Index = J End if Index> J Then 'Still add as the last data J = J + 1 'Index bit only increases by 1 Index = J 'Redefine the index bit to prevent exceeding the range End if redim Temp (J-1) As Variant 'Redefinition Array For I = 0 To Index-1 temp (I) = item. Values (I) Next I = index To J-1 temp (I) = item. Values (I + 1) Next call Doctt. replaceitemvalue (fieldname, temp) 'End if' end if End sub
3. Change Data in a multi-value domain
Edititemvalues (multi-value domain name, changed index value, changed content, Document Object)
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 Index> J Then 'Still add as the last data J = J + 1 'Index bit only increases by 1 Index = J 'Redefine the index bit to prevent exceeding the range End if redim Temp (j) As Variant 'Redefinition Array 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