trichview.com

trichview.support




Re: Tables\Cells styles


Return to index


Author

Message

Yernar

Posted: 01/28/2003 21:06:07


Here's a simple example:


function FindTableByName(MyRichView: TCustomRichView; const TableName: string):

  TRVTableItemInfo;

var

  I: Integer;

begin

  Result := nil;

  for I := 0 to MyRichView.ItemCount - 1 do

    if (MyRichView.GetItemStyle(I) = rvsTable) and (MyRichView.GetItemText(I)

=

      TableName) then

    begin

      Result := TRVTableItemInfo(MyRichView.GetItem(I));

      Exit;

    end;

end;


procedure TForm1.Button1Click(Sender: TObject);

var

  Table: TRVTableItemInfo;

begin

  Table := FindTableByName(OrganizeRichViewEdit, 'Body');

  if Table <> nil then

  begin

    Table.Select(0, 0, Table.Rows.Count - 1, Table.Rows[Table.Rows.Count

-

      1].Count - 1);

    Table.ApplyParaStyleToPartiallySelected(0);

    Table.Deselect;

    OrganizeRichViewEdit.Format;

  end;

end;




"Massimo" <[email protected]> wrote:

>Hi,

>

>I have a document containing a table somewhere; how can i find it and

>apply/change style to its text or to a single cell?

>

>Thanks.

>

>





Powered by ABC Amber Outlook Express Converter