Print Page | Close Window

RichEditor : Convert to plain text

Printed From: TMS Software
Category: VCL Components
Forum Name: VCL General
Forum Discription:
URL: http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=13412
Printed Date: 20 Sep 2019 at 7:11am


Topic: RichEditor : Convert to plain text
Posted By: dehorter olivier
Subject: RichEditor : Convert to plain text
Date Posted: 13 May 2019 at 11:25am
Hi

How to convert an Html (or richedit) version to plain text in the same advRichEditor ?

I use a checkbox in order to indicate if I can use html enhancement or just use the plain text.

When the text use already html format, and I switch to plain text format, how to delete all enhancement (bold, italic, etc ) already present.

I try to use stream property without success :(

regards
olivier



Replies:
Posted By: Bruno Fierens
Date Posted: 13 May 2019 at 11:58am
You can use:
AdvRichEditor.ContentAsPlainText: string;


Posted By: dehorter olivier
Date Posted: 13 May 2019 at 1:00pm
Hi

In order to retrieve the linebreak, I do this :

                Chaine := vTexte.ContentAsPlainText;
                liste.Text := Chaine;
                vTexte.Clear;
                FOR i := 0 TO liste.Count - 1 DO
                BEGIN
                    IF i > 0 THEN
                        vTexte.AddLineBreak;
                    vTexte.AddText(liste.Strings);
                END; //  Fin de FOR
regards
olivier




Print Page | Close Window