How to copy HTML Formatted text As HTML to ClipBoard in Firemonkey

  

Using Delphi FireMonkey, I need to copy HTML formatted string to the clipboard in Delphi so that other application pasting it will see it as HTML.
I already trying to copy simple text through a hidden Memo component and it work but is copied as simple text. I need HTML format copy. Having it as text, when pasting in any rich text program it shows all the HTML tags instead of formatted text.
My Current approach for copying text to clipboard is:
procedure TForm1.Button1Click(Sender: TObject);
var
SourceText: string;
begin
SourceText := ‘This is a <b>bold</b> html line’;
//I can use TMemo to copy it to clipboard like:
Memo1.lines.Text := SourceText;
Memo1.SelectAll;
memo1.CopyToClipboard;
end;

But the problem is that if I paste the text copied on clipboard in Microsoft word it will be pasted as:

"This is a <b>bold</b> html line". I want and it should be like:

This is a bold html line

Note: I have read other discussions about how it can be done in windows but I need a Firemonkey solution for a cross platform application. Any help is appreciated.

Comments are closed.