Call ctxDump.getRichTextItem(doc,"Body")
' let's read the RichText of Body field
' some declarations
Dim coll As rtCollection, table As rtTable
Dim o As Variant
Dim keys(1), order(1), alpha(1) ' arrays that contain directions for sort - may be simple variants True/False instead of arrays - see bellow
Dim headerRows As Integer ' number of header rows (not sorted)
Dim sortEmptyBehind As Variant ' true if empty colums sort at the end (in case of asc order)

Set coll = ctxDump.Collection (PARSE_GROUP_TABLE)
Set enum = New rtEnumeration(coll)
' Set enum = ctxDump.Tables
Do While enum.hasMoreElements
 Set table = enum.nextElement
 Call table.sort(2, true, false,1,false)
 ' column(s), alphabetic (true)/numeric, direction ascend(true), header rows, sort empty cells at the end
Loop
|