Paste text with target font but keep styles
Posted: Fri Oct 20, 2023 7:15 pm
Hello Sergey,
i give up. How can I transfer text to a TRichViewEdit with the following requirements:
In the target RV there is a certain formatting, e.g. Courier New 12.
In Word or somewhere else, I select text that is formatted in, say, USA light, and put it on the clipboard. This text has underlined and bold items, i.e. different TextStyles.
Now I want the text in my target RV to be formatted in Courier New as well, but the italic and bold items are taken over the same, but in Courier New, that the pasted text matches the existing one.
It is important that only the styles are taken from the other text and nothing else.
I have tried all sorts of things, even using a TRichEdit as a bridge, of course using another TRVEdit and transferring via stream or copy&paste, also paste directly, but nothing works cleanly.
Also here in the forum I have found nothing that has helped me.
Do you have any idea how I can solve this?
Regards
Martin
i give up. How can I transfer text to a TRichViewEdit with the following requirements:
In the target RV there is a certain formatting, e.g. Courier New 12.
In Word or somewhere else, I select text that is formatted in, say, USA light, and put it on the clipboard. This text has underlined and bold items, i.e. different TextStyles.
Now I want the text in my target RV to be formatted in Courier New as well, but the italic and bold items are taken over the same, but in Courier New, that the pasted text matches the existing one.
It is important that only the styles are taken from the other text and nothing else.
I have tried all sorts of things, even using a TRichEdit as a bridge, of course using another TRVEdit and transferring via stream or copy&paste, also paste directly, but nothing works cleanly.
Also here in the forum I have found nothing that has helped me.
Do you have any idea how I can solve this?
Regards
Martin