Convert RTF string to list

I have an application that stores large amounts of id numbers in a RTF. I need to have a process that runs in an agent in the background at night that will get the RTF string,

stringValue = doc.GetItemValue(“RTFField”).

'examplestring = “1;2;3;4;5;6;7;8;9”

I then need to convert the string to a list so I can loop thru the values 1 by 1.

Forall x In stringList

End Forall

I have been ubable to create this list. I have tried split, but I can only get split to work in the ui and this agent is not working in the ui.

newvalue = Split(stringList, “;”)

I have also tried the Evaluate statment but can’t get it to work either.

temp = doc.GetItemValue(“RTFField”)

'examplestring = “1;2;3;4;5;6;7;8;9”

stringList = Evaluate( |@Explode(“| + temp + |”)|, doc)

Does anyone have any ideas what I could do?

Subject: Convert RTF string to list

You need a string value, and GetItemValue doesn’t return that. Use the rtitem.GetFormattedText method instead