There is a small desktop application written in java. I wrote code that allows you to work with the clipboard application (i.e. copy and paste text). And how to make my application skillfully copy to the clipboard (and get) the formatted text. That is, so that I could apply the font, color, size to the text, then copy it and paste, for example, in Word and the text was also formatted?

  • In the buffer, besides the text, something else is saved. You can try searching deeper. - Anton Mukhin

1 answer 1

Yes Yes. In addition to text, you can set the mime-type, and then you can, for example, put text / html, so that the Word can receive formatted text.

For example, like here: Copying HTML to the clipboard from Java .

  • Searched more on the Internet. People claim that you can use [RTF] [1] rather than HTML. What is the difference and what is better? [1]: en.wikipedia.org/wiki/Rich_Text_Format - angry
  • HTML is easier and everyone knows it. I personally don’t remember the RTF format and it can be complicated in some cases. But in principle, yes, you can use other formats. If only the vord understood him. - cy6erGn0m