Problem copying rtf between controls

  • Hello,

    I want to copy the selected text from one edit control to another. I have the following code:

    WPEdit1.TextSaveFormat := 'RTF';
    WPEdit2.TextLoadFormat := 'RTF';
    WPEdit2.AsString := WPEdit1.SelectionAsString;

    The RTF in WPEdit1 looks like this:

    \plain\f0\fs16\cf0 This is a test.\par

    But the RTF in WPEdit2 looks like this:

    \plain\f1\fs16\cf0 T\plain\f1\fs16\cf0 hi\plain\f1\fs16\cf0 s \plain\f1\fs16\cf0 is \plain\f1\fs16\cf0 a \plain\f1\fs16\cf0 t\plain\f1\fs16\cf0 e\plain\f1\fs16\cf0 s\plain\f1\fs16\cf0 t.\par

    There are lots of extra RTF codes in there. Is there any way to get the RTF to copy exactly?

    Thank you,

    Pat Breslin