How do you store all values from a multi-value field for all documents you are processing? I am trying the following code but my values are always overwritten.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim item As NotesItem
Dim duplicatedNameIDX As Integer
Dim duplicatedNames() As String
Dim cleanNames As Variant
Redim duplicatedNames(0)
Set db = session.CurrentDatabase
Set view = db.GetView("ConversionApproverNames")
Set doc = view.GetFirstDocument
Do While Not doc Is Nothing
Set item = doc.GetFirstItem( "Approver1")
varApprovers = item.Values 'save the approver names off
Redim Preserve duplicatedNames(Ubound(duplicatedNames) +Ubound(varApprovers) )
For duplicatedNameIDX = 0 To Ubound(varApprovers)
strCommonName = Cstr(varApprovers(duplicatedNameIDX))
duplicatedNames(duplicatedNameIDX) = strCommonName
Next
Set doc = view.GetNextDocument(doc)
intRecordsProcessed = intRecordsProcessed + 1
Loop
Subject: RE: storing multiple item values from a multi-value fields to an Array
It spins through all of the items fine but when it goes to moe the strCommonName to duplicatedNames(duplicatedNameIDX) it overlays what it there. I stepped though the debugger and I think the problem could be that the upperbound of the varApprovers is often times 0. So when it sets the range for the index (the from) it sets back to 0. I tried various things but cannot get it to work.