Forum > LCL

Converting TRichMemo content to HTML


Hasn't anybody know such a feature?   Supporting only bold, underline, and italic is sufficient.

Currently I'm using TMemo to get text input, and my web-server uses the content as part of HTML page. I copy a paragraph from word processor, e.g. MS-Word, which contain bolded words. But when I copy it into TMemo then all the font style definitions are gone.  If I'd like to make some words bold, I have to input <b> and </b> manually.

So I'm considering using TRichMemo instead of TMemo. I'm looking for a simple way.

I tested copying MS-Word paragraph into both TMemo and TRichMemo. In the attached image, the left one is TRichMemo, and the right one is TMemo.


Thank you very much, paweld.  I'll review the codes.

There is a better one, written by Marco Cantu, that compiles without change in {$mode delphi}.
The link above is to code that might have been useful for Delphi 1, but shows its age.
The code by Marco is also old, but much better designed and is still relevant.

@Thaddy: I checked the code you shared in one of the threads, but it doesn't work "out of the box".
I also had the code shared by ruthjes@******.nl in my archive, which works, but unfortunately has a problem with UTF-8 characters.


[0] Message Index

Go to full version