If you ever needed to paste a code that you have written in your favorite IDE or editor inside Microsoft Word and do not want to lose your formatting, then PlanetB is a really great tool that gives you that opportunity. It has a really easy-to-use user interface. It comes with the support for several programming languages like: C/C++, C#, CSS, Delphi, Pascal, XML, Java, Javascript, PHP, Python, Ruby, SQL, VB and HTML.
All you have to do is visit PlanetB here and simply paste in the code snippet that you want to include in your Microsoft Word document. It will keep its formatting as you have pasted it in there.
You can see an example down below:
Here is a code snippet written in Ruby:
Now we need to go to PlanetB and paste our code in there:
After we hit Show Highlighted we will see a page opens previewing the code that we need to copy:
Now we can copy and paste it on our Microsoft Word document:
That’s it. I hope you enjoy it.