Link to home
Start Free TrialLog in
Avatar of maqskywalker
maqskywalker

asked on

Copying C# code from Visual Studio 2015 to Microsoft Word

I use both Visual Studio 2013 and Visual Studio 2015.

I have a ASP.NET MVC web application.

I have a C# file open.

I noticed that when I select my C# code from Visual Studio 2013 and paste it in Microsoft Word.
The code that gets pasted into my Word document is in color.

But then, I noticed that when I select my C# code from Visual Studio 2015 and paste it in Microsoft Word.
The code that gets pasted into my Word document is in not in color. It's black.

Anyone know the reason why the C# code i copy from Visual Studio 2015 to Word is black?
It works fine on Visual 2013.
How do I fix Visual Studio 2015 so my C# code is in color like the way it is in Visual Studio 2013?
ASKER CERTIFIED SOLUTION
Avatar of crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of maqskywalker
maqskywalker

ASKER

My word settings are the same. That didn't do it.

Here's something that I noticed.

If I copy 233 lines of code or less and then I paste it into word then the code does show up in color in word.

But if I copy more than 235 lines of code and then paste it into word then the code is all black.

In Visual Studio 2013 any amount of lines of code that get pasted into word show up in color.
that is odd ... but at least you know what to do!
Or use Notepad++ as a "middleman". Paste code into Notepad++, change language then use copy RTF
User generated image
very nice to know about copying RTF, Shaun, Thank you!  I currently run code through code I wrote to add color but now I am thinking about customizing NotePad++ for VBA since I usually pick VB, which is close but not quite right.