rtLib — Notes Rich Text Management Library Documentation of rtLib — Notes Rich Text Management Library Download rtLib — Notes Rich Text Management Library FAQ of rtLib — Notes Rich Text Management Library Purchase rtLib — Notes Rich Text Management Library Feedback about rtLib — Notes Rich Text Management Library

Cookbook

Embedded Table Sort

Start search Mail feedback Back to Description


rtTable

Collection (rtContainer) Collection (rtEnumeration) getRichTextItem hasMoreElements NextElement sort tables

Code fragment from sample "Embedded Table Sort"; see full running samples in downloadable help.
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