Change style to part of text

General TRichView support forum. Please post your questions here
Post Reply
apicito
Posts: 9
Joined: Mon Jul 17, 2006 10:34 am

Change style to part of text

Post by apicito »

I insert into table cell a texto:

Code: Select all

  table.Cells[0,0].AddNL( 'aaaaaaaaaaaaaaaaaaaaa '+cargo+' bbbbbbbbbbbbbbbb',7,3);
I need insert "cargo" variable in other style (Bold). How I do it?
Last edited by apicito on Tue Apr 17, 2007 9:33 am, edited 1 time in total.
Sergey Tkachenko
Site Admin
Posts: 17524
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do you want to do it as an editing operation (that can be undone by user?)
apicito
Posts: 9
Joined: Mon Jul 17, 2006 10:34 am

Post by apicito »

I need compose a document for print without user intervenction.
Sergey Tkachenko
Site Admin
Posts: 17524
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Why not to use several AddNLs then?
apicito
Posts: 9
Joined: Mon Jul 17, 2006 10:34 am

Post by apicito »

Because is the same paragraph and addN insert a new line.
Sergey Tkachenko
Site Admin
Posts: 17524
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

AddNL can add text in the same paragraph, pass -1 to ParaNo parameter:

Code: Select all

with table.Cells[0,0] do begin
  Clear;
  AddNL( 'aaaaaaaaaaaaaaaaaaaaa ', 7, 3);
  AddNL( cargo, 8, -1);
  AddNL( 'bbbbbbbbbbbbbbbb', 7, -1);
end;
apicito
Posts: 9
Joined: Mon Jul 17, 2006 10:34 am

Post by apicito »

thanks
Post Reply