I have 2 sets of fields in a document. ponum1 thru 10 and polink1 thru 10. It is my understanding when you want to move the values in 1 item to another , it goes like this doc.polink1 = doc.ponum1(0).
Subject: building multiple item moves within a doc
The problem is that if you’re using the document.fieldname(index) shorthand syntax, you can’t dynamically build the fieldname as if it were a string. You’re almost there with your use of ReplaceItemValue, but for that you can’t use the (index) notation. You might try something like this:
For x = 1 to 10
’ first, just generate some field names
ponum = “ponum” + cstr(x)
polink = “polink” + cstr(x)
’ get the value(s) of the ponum field
num_vals = doc.GetItemValue(ponum)
’ and slap those into the link field
set itm = doc.replaceitemvalue(polink, num_vals)
’ save it; otherwise, we’ll reset what itm is on the next loop through and lose the previous item value changes