Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax highlighting in MS Word document [closed]

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?

like image 802
Arun Avatar asked Mar 31 '10 22:03

Arun


People also ask

How do I get rid of highlighting in Word that won't go away?

Remove highlighting from part or all of a document Select the text that you want to remove highlighting from, or press Ctrl+A to select all of the text. Go to Home and select the arrow next to Text Highlight Color. Select No Color.

Why does my Microsoft Word keep highlighting?

Highlighting is formatting. When you start a new paragraph, by default it will continue in that paragraph. Start a new paragraph. Click in the left margin to select the entire paragraph.

What is closed in MS Word?

Closing a document frees up more computer memory for other activities. Closing a document is different from exiting, or quitting, Word; after you close a document, Word is still running. You close a document by using the Close command on the File tab (New!), which keeps the Word program window open.


2 Answers

I've found a tool similar to this found by darlinton, but having several different styles of colouring: http://tohtml.com/. I hope it would help.

like image 31
Lukasz Czerwinski Avatar answered Sep 21 '22 23:09

Lukasz Czerwinski


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.

like image 138
Ethan Liu Avatar answered Sep 21 '22 23:09

Ethan Liu