procedure EnumColoredText(RVData: TCustomRVData);
var i, r, c, StyleNo: Integer;
table: TRVTableItemInfo;
begin
for i := 0 to RVData.ItemCount-1 do begin
StyleNo := RVData.GetItemStyle(i);
if (StyleNo>=0) and
(RVData.GetRVStyle.TextStyles[StyleNo].BackColor<>clNone) then begin
// do something with RVData.GetItemText(i)
end
else if StyleNo=rvsTable then begin
table := TRVTableItemInfo(RVData.GetItem(i));
for r := 0 to table.RowCount-1 do
for c := 0 to table.ColCount-1 do
if table.Cells[r,c]<>nil then
EnumColoredText(table.Cells[r,c].GetRVData);
end;
end;
end;
As for SelectAll error, you need to call rve.Format after loading files.
As for problems with Unicode file names, I am afraid it is unavoidable, because converters work with OEM file names. The only solution is creating a temporal copy of this file and import it.
Sergey Tkachenko wrote:1)
...
Unfortunately, there are no ways to exclude pictures or tables when inserting RVF (RichView Format), so you may exclude it as well (well, there is a way: pasting in a hidden TRichViewEdit, removing pictures and tables in it, saving this hidden RichViewEdit using SaveRVFToStream, then inserting in the main editor using InsertRVFFromStreamEd).
Additionally, pictures or tables can appear as a result of drag&drop. You can exclude formats from AcceptDragDropFormats property.
i've set the AcceptDragDropFormats just like this:
rve.AcceptDragDropFormats:=[rvddRTF, rvddText, rvddUnicodeText];
but it still drops everything that is dragged from i.e. ms word and does not filter anything!