Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple word processing

Status
Not open for further replies.

EricDraven

Programmer
Jan 17, 2002
2,999
GB
Hi all,

I currently have a mailshot system incorporated into my program allowing users to send letters out to everybody they wish. They can currently select which font the letter is in and so forth. I would like them to be able to (using a richedit) select different fonts, sizes, colors and styles (ala M$Word) for different text of the letter. I hace had varying degrees of success using the select text funstions but if anybody has any examples of this I would be most greatful.

Oh and I dont need another downloadable component to bump up the size of my program because this is all I need it to be able to do!

Any help greatly appreciated!

Many thanks Eric Draven Arte Et Labore
 
Hey, Eric. Once you've selected text in RichEdit you can can format it like this:
Code:
...
  with RichEdit do
  begin
    Name := 'MS Sans Serif'; // Setting font name.
    SelAtributes.Color := clRed; // Set font color.
    SelAtributes.Style := SelAtributes.Style + [fsBold]; // Setting bold font
  // can also use fsItalic, fsUnderline, fsStrikeOut
...
  // To remove a style
    SelAtributes.Style := SelAtributes.Style - [fsBold]; 
  end;
...
end;
For more details read about TTextAttributes.
Cheers.

--- markus

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top