Board index » delphi » Richedit colors and saves

Richedit colors and saves

Two questions

1) Is their a way to make a Richedit comp. turn a word a
different color at a certain column number
     (example line 1 column 8)

2) Is their a way to save a Richedit as a plain text file.

Please E-Mail me with any Help .

Thank You for any Help.
Chris Godwin
cgod...@frost.snowhill.com

 

Re:Richedit colors and saves


Quote
> 1) Is their a way to make a Richedit comp. turn a word a
> different color at a certain column number
>      (example line 1 column 8)

You will probably have to select the word with SelectStart and SelectEnd and
change the SelAttributes.

Quote
> 2) Is their a way to save a Richedit as a plain text file.

var
        list: TStringList:
begin
        list := TStringList.Create;
        list.Assign( RichEdit.Lines );
{ the assign method will strip out any formatting added by RichEdit and leave
you with plain text }
        list.SaveToFile( filename );
        list.Free;
end;

        That ought to do it.

                Dave

Re:Richedit colors and saves


Quote
> You will probably have to select the word with SelectStart and SelectEnd
and
> change the SelAttributes.

Whoops, I meant SelectLength. Sorry.

Other Threads