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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to clear RICHEDIT

Status
Not open for further replies.

RyanEK

Programmer
Apr 30, 2001
323
0
0
AU
Hi All,

I have a TRichedit and i'm loading an RTF file via the loadfromfile command. However the rtf file has the following tags:

lang1033\protect\f0\fs20

It looks like this protect tag, is making the Richedit control read-only!. Hence, I can't delete or clear the text. Does anyone know how these protect tags are being created? I think the richedit doc. was created by copying text from a Word or Email document.

thanks
Ryan
 
ar u shure the read only property is marked false;
try richedit1.lines.loadfromfile();
richedit1.readonly := false;
 
Nope, the readonly attribute it definitly off. I'm thinking the text was copied from a secure email or something... anyone have any idea?
 
After you have loaded the rich text into the control try:
Code:
richedit1.SelStart := 0;
richedit1.SelectAll;
richedit1.SelAttributes.Protected := false;
Hope this may help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top