Appendtotextlist from the top?

My Code:

Set item = doc.GetFirstItem(“Comments”)

Call item.AppendToTextList(“NOTE: " & didoc.CommField(0) & " - " & s.CommonUserName & " (” & Now & “)”)

How can I display the most recent comment added at the top? The code above places it at the bottom?

Thanks in advance :wink:

Subject: appendtotextlist from the top?

You could do the following:

  1. retrieve current contents in a redim array, starting at the second entry of this array

  2. add the new value into the first entry of this array

  3. call document.ReplaceItemValue([fieldname], [redim array])

Subject: RE: appendtotextlist from the top?

Thank you Rob, I will give it a try.

Subject: appendtotextlist from the top?

I do not know how much of a change it would be for you but you could do something like…

Dim newComments(0) As String

newComments(0) = “NOTE: " & didoc.CommField(0) & " - " & s.CommonUserName & " (” & Now & “)”

doc.Comments = Arrayappend(newComments, doc.Comments)

Subject: RE: appendtotextlist from the top?

Thank you James! It worked 100%. I had some trouble getting the Redim to work, and was happy to find your post. Thank you!

Subject: RE: appendtotextlist from the top?

Glad I was able to help.