When you send a WM_COPY message to a RichEdit control having a numbered list selected, and then paste the text into Notepad, the numbers are not included. Is there any way to get them? Thanks!
Asked
Active
Viewed 294 times
1 Answers
1
You don't get the numbered list because Notepad does not support text formatting such as bullets, bold, numbering etc.
The target application must support rich text. Copying from RichEdit and pasting in Wordpad, MS Word, Html Editor works well.
Thanks.

Gautam Jain
- 6,789
- 10
- 48
- 67
-
But I consider list numbers to be part of text. What to do if I want to retain them in plain text? – Alex Jenter Apr 26 '11 at 06:57
-
Then you need to override the bullets & numbering functionality of RichText so that the bullets are inserted as part of text and not part of formatting tags. It is lot of work though. – Gautam Jain Apr 26 '11 at 07:24
-
The problem with that approach would be that WordPad and Word now won't be able to recognize these as lists. I'm thinking in the following approach: intercept WM_COPY and put CF_TEXT and CF_RTF into clipboard. CF_TEXT with the numbers and CF_RTF with the styles. Do you think this might work? – Alex Jenter Apr 26 '11 at 07:57
-
Sounds like a good idea. You would need to detect which line has numbers from the RTF format and also what number each line has. Again, if the user drags and drops the text from the RichText, this approach won't work. – Gautam Jain Apr 26 '11 at 13:38