AdvRichEditor un-formating text

Hello TMS team!

I'm using the AdvRichEditor but the custome is only allowed to do some simple formating in the text.
If one paste text from i.e. Word into the text field all formatings are pasted too - what is really nice in fact!

my question:
is it posible to remove all format info from text programatically?

In AdvRichEditor documentation I only found how to set formattings but not how to unset...

The best solution would be to optional suppress "formatted paste" by property :)

regards, Frank


Right now, when performing a paste, it first tries the RTE format, then RTF, then HTML and finally plain text, to get the most rich possible representation of the clipboard data.

In order to be able to control this, we have added a public property that will be available in the next version that will enable you to exclude any of the supported formats. Example:

AdvRichEditor.ClipboardFormats := AdvRichEditor.ClipboardFormats - [cfRTE];

will exclude the RTE format from pasting.

Hello Bruno,
like every time the most excellent answer! Thank you very much!

But anyway: is it possible to scan for formattings - i.e. color change?

I'm not sure I fully understand your question. You want to remove color tags from the pasted text? Something else?

Yes, you are right.

Following situation:
uses pastes some formatted text into the RichEditor and after that, I want to scan the
whole text for "unwanted" styles and remove them. That was the idea...

There is currently not a built-in way to do this. Best we can do is add an event that is triggered when the Paste is happening that provides the pasted text as a formatted document that can be worked on at application level before it is actually pasted.