trichview.com

trichview.support




Re: SaveTextToStream problems


Return to index


Author

Message

Muhammad

Posted: 05/25/2003 7:12:35


Hi!

I used this code and it work very well

var

    Stream: TMemoryStream;

    Str: TStringList;

begin

    Stream := TMemoryStream.Create;

    RV.SaveTextToStream('', Stream, 10, False, True);

    Stream.Position := 0;

    Str := TStringList.Create;

    Str.LoadFromStream(Stream);

    ShowMessage(Str.Text);


and it work well

regards


"Yoerdes" <nospam@nospam.com> wrote in message

news:3ED012BD.50401@nospam.com...

> Hi,

>

> I want to get the contents of a TRichViewEdit as a simple string

> and use the following code to achieve this:

>

> procedure TForm1.Button1OnClick(Sender: TObject);

> begin

>    Label1.Caption := GetPlainText;

> end;

>

> function TForm1.GetPlainText: string;

> var

>    Stream: TMemoryStream;

>    s: string;

> begin

>    rve.SaveTextToStream('', Stream, 0, false, true);

>    SetLength(s, Stream.Size);

>    Stream.Read(s[1], Stream.Size);

>    Result := s;

> end;

>

> If the text in the TRichViewEdit doesn't have any special items, it

> works as expected. But if there is a hyperlink included the result

> nonsense.

> No luck when setting TextOnly := false; either.

>

> Regards

> Yoerdes

>

>

>

>

>





Powered by ABC Amber Outlook Express Converter