CRicheditctrl- copy paste

abc abc 351 Reputation points
2020-09-29T10:02:37.097+00:00

Hi,

when copy a word from microsoft word paste to cricheditctrl in MFC using ctrl+v, the default line spacing in cricheditctrl is changing. How to avoid that or how to paste text with default line spacing?

Thanks

Developer technologies | C++
{count} votes

Accepted answer
  1. RLWA32 49,651 Reputation points
    2020-09-30T11:42:10.3+00:00

    I decided to do a simple experiment. I copied some rich edit text with font and color formatting to the clipboard from Wordpad. Then I pasted the text into a rich edit control using both Paste() and PasteSpecial(CF_TEXT). The results speak for themselves.

    Source text from Wordpad
    29435-worpad-rtf.png

    Rich edit control before any pasting from the clipboard
    29405-before-rtf.png

    Rich edit control after pasting using both methods
    29378-control-rtf.png

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.