Do you have an example project that uses TableSort.pas? I could probably muddle through how to apply it, but a working example would make the process a lot quicker Belated Happy New Year, BTW!
var rvet: TCustomRichViewEdit;
table: TRVTableItemInfo;
if not RichViewEdit1.GetCurrentItemEx(TRVTableItemInfo, rvet, TCustomRVItemInfo(table)) then
exit;
// display your modal form allowing choosing sort options
// and column (in range 0..table.ColCount-1)
SortCurrentTable(RichViewEdit1, Column, Ascending, IgnoreCase);