Word – Syntax highlighting not retained when pasting from Notepad++ into Word

microsoft wordnotepad

I'm trying to copy code snippets from Notepad ++ to Microsoft word, which somehow doesn't seem to work.

I DO know that there is a standard, well answered question already. However, I seem to be unable to follow the steps. Everything works fine, until I paste into Microsoft Word, when I get nothing but black text.

I've tried a combination of

  • Plugin Commands > Copy Text with Syntax Highlighting from Notepad++
  • Plugin>NPP Export > Copy {RTF/HTML/all formats} to clipboard from Notepad++
  • Paste, Keep Original Style(K) in Word
  • Home > Clipboard > Select and Paste > {RTF/HTML} in Word
  • Home > Open Clipboard(That little arrow at the bottom right corner at the clipboard menu) > paste in Word
  • Insert > Insert Object > Open Document Text in Word
  • Clean Clipboard
  • Restarting Notepad ++, Word
  • Rebooting

But still I get black, plain text in Word. Any suggestions as to why this might occur? I'm using Word 365, Notepad++ 7.7, Windows 10.


Best Answer

[Answer edited after the reported issue was finally resolved.]

At the time the question was asked, this did indeed not work as described in the Stack Overflow question, or the question here for that matter. The issue had been reported on the Notepad++ bug tracker and was due to the fact that the plug-in NPP Export 0.2.8 did not work in Notepad++ 7.7.

The corresponding issue with the plug-in has since been fixed. As of the release of Notepad++ 7.8 in October 2019, a working version of the plug-in is again available through Notepad++'s built-in plug-in manager. So downgrading to an older Notepad++ version, pre 7.7, is no longer necessary. Upgrading to 7.8 or newer is the better option.