Syntax highlighting in microsoft word

Syntax highlighting  n microsoft word

Here is the best way, for me, to add code inside word:

Download and install Notepad++ and do the following:

  1. Paste your code in the window;
  2. Select the programming language from the language menu;
  3. Select the text to copy;
  4. Right click and select Plugin commands -> Copy Text with Syntax Highlighting;
  5. Paste it into MS Word and you are good to go!

 

 

Notepad++ has a plugin called “NppExport” (comes pre-installed) that allows you to copy to RTF, HTML and ALL. It permits dozens of languages, whereas the aforementioned IDEs are limited to a handful each (without other plug-ins).

I use Copy all formats to clipboard and “paste as HTML” in MS word

 

screenshot from notepad++

Result

 

SRC

Leave a comment

Your email address will not be published. Required fields are marked *