Hi all,
hope someone can help me …
I try to replace the content of a textlist with part of old values and new values. I have the following script:
…
Set item1 = doc.GetFirstItem(“textlistfield”)
Call doc.RemoveItem(“textlistfield”)
Set item2 = New NotesItem (doc,“textlistfield”,“”)
…
The problem is that the values of item1 are removed when I remove the field “textlistfield”. But I need to store the values in a temporary variable.
thanks for any help
Subject: replacing values in a textlist field
I’m not sure what your problem is but you can store this values in an array. The easiest way is to use a variant. Thus :
…
dim temp as variant
Set item1 = doc.GetFirstItem(“textlistfield”)
temp=item1.values 'temp is now an array of strings
Call doc.RemoveItem(“textlistfield”)
Set item2 = New NotesItem (doc,“textlistfield”,“”)
…
or shorter :
…
dim temp as variant
temp=doc.textlistfield ’ temp is now an array of strings, conataining all values in textlistfield
… manipulate your array here …
doc.textlistfield = temp
…
Subject: RE: replacing values in a textlist field
yes, thanks … it works fine!