It needs to work with tables that are only 1 level deep (i.e. they never have tables in the tables).
This is what I tried and I thought might work:
Code: Select all
RVE.BeginUpdate;
RVE.GetSelectionBounds(StartItemNo, StartItemOffs, EndItemNo, EndItemOffs, true);
if RVE.RVData.GetItemStyle(StartItemNo) = rvsTable then begin
TableRVE := RVE.TopLevelEditor;
TableRVE.GetSelectionBounds(TableStartItemNo, TableStartItemOffs, TableEndItemNo, TableEndItemOffs, false);
end;
...
(Add or remove items before the current item)
(Update StartItemNo and EndItemNo to reflect the items added or removed)
...
RVE.SetSelectionBounds(StartItemNo, StartItemOffs, EndItemNo, EndItemOffs);
if RVE.GetCurrentItemEx(TRVTableItemInfo, TableRVE, TableItem) then
TableRVE.SetSelectionBounds(TableStartItemNo, TableStartItemOffs, TableEndItemNo, TableEndItemOffs);
RVE.EndUpdate;
The document is formatted prior to this code.
I have tried adding an RVE.Invalidate just before the RVE.EndUpdate. but that doesn't help.
Any suggestions as to how I can get this to work?
Thanks.
Louis