Hi,For this script, when i have under 800 documents in the list it works.
But, over 800 documents I have an “Operation failed” error. The error occured at the Evaluate function line.
Someone has an idea to resolve the problem ?
Thank you very much.
Bob.
'Merge fields into list that can be used for sorting using @Sort function
For i = 0 To coll.Count - 1
If Not strSort = “” Then strSort = strSort & “:”
strSort = strSort & “”“”
For n = LBound(fieldnames) To UBound(fieldnames) + 1
strSort = strSort & Left(arrSort(i,n) & Space(arrFieldValueLength(n)), arrFieldValueLength(n))
Next n
strSort = strSort & “”“”
Next i
’ —
’ — 2) Sort array
’ —
arrSort = Evaluate(“@Sort(” & strSort & “: " & directionSort &”)")
’ —
’ — 3) Use sorted array to sort collection
’ —
Set collSorted = coll.Parent.GetView(viewname).GetAllDocumentsByKey(fakesearchstring)
For i = 0 To Ubound (arrSort)
Set doc = db.GetDocumentByUNID(Right(arrSort(i), 32))
Call collSorted.AddDocument(doc)
Next i
’ —
’ — 4) Return collection
’ —
Set SortCollection = collSorted
Exit Function