Syntax highlighting in MS Word document

Arun picture Arun · Apr 1, 2010 · Viewed 31.5k times · Source

I want to insert some C/C++ source code into a Microsoft Word document. I have no problem in copying the code from source file and pasting into Word. I can do fixed-width. But, in Word, I see the code in black-and-white format; I loose the syntax highlighting as I get in the source code editor (for me, gvim). So, my question is, is there any way to do syntax highlighting of C/C++ source code in MS Word?

Answer

Ethan Liu picture Ethan Liu · Jan 23, 2012

I found Notepad++ also can copy the code as .rtf file. Plugin/NppExport/Copy RTF to Clipboard, Then you can paste them into word with highlight and layout.