File this under “how did I not already know this.”
I put together quite a few PowerPoints and Word documents explaining how to do labs. And since I teach computer science, many of these include source code of some type.
Normally I just type it in and change the font to Courier New or Lucida Sans, which works okay. But syntax highlighting would make everything easier to follow; it’s just been more effort to highlight each section individually that I’ve always left the text black. Thanks to this post I found a much easier way to get it working.
The key is a plugin in Notepad++ called NppExport.
First thing to do is type your code into Notepad++, making sure the language you’re using is selected. The example here is Python, but anything that Notepad++ can highlight will work.
Next, go to the Plugins menu and select NppExport -> Copy all formats to clipboard.
Then it’s just a matter of going to Word, PowerPoint, or whatever program you want and paste it in.
NppExport will also allow you to both copy and save as RTF and HTML as well.