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

RTF Source from RichEdit Control?

Status
Not open for further replies.

UKChris

Programmer
Jul 2, 2001
5
0
0
US
I'm trying to figure out if I can get RTF Text from a Rich Edit Control. If I put the control on screen I can paste into it nice formatted text and it displays fine.

However, if I copy the RichEdit1.Lines to a Memo1.Lines it all appears as plain text, what I'm looking for is text with RTF markup codes in it, for want of a better term "Raw RTF". Any ideas how I might get that?

Chris.
 
TMemo only handles plain text. If you copy (ctrl/C) some rich text from another source (say MSword) and paste it (ctrl/V) into TMemo it will be plain. Paste it into TRichEdit and it will retain its formatting.
 
You could save the text from the richedit control to a file, and then load that file into the memo. It should display the formatting then.


rtfMemo.Lines.Savetofile('filename.rtf');
memo.lines.LoadFromFile('filename.rtf');


That should do it...
TealWren
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top