I used to copy the text of my C# code in a word document to have a backup of my progress. Previously the color of the codes (blue, black, green) was kept when I paste it in any text editor program (MS word, WordPad ...). Recently it is not so. The format of the text (indentations) is kept but the color unfortunately is just black. That helped me a lot to have previous version of my code on another monitor. The codes are displayed just normal in Microsoft Visual Studio but the color is lost when I copy and paste it anywhere else. (I have checked the paste setting of MS word and they are set to keep the formatting of the source. The problem shouldn't be there.)
I use Microsoft Visual Studio Professional 2019.
Edit and answer:
The problem was that although the "cope rich text on copy/cut" option was checked, my code exceeded the maximum character count for this property. It was solved by changing the "Max Length" to a very big number. Default is 10240 and I added three more zeros.
Therefore the path to the solution is:
Tools --> options --> Text Editor --> Advanced --> Copy rich text on copy/cut (checked) --> Max Length (a very big number)
You need to check the options "Copy rich text on copy/cut" and "Use accurate classification" in the Text Editor->Advanced settings dialogue within Visual Studio 2019.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With