How to: C# source with syntax highlighting on PowerPoint slides

I would like to show some C# source code in a PowerPoint presentation. But how can I copy the code including the syntax highlighting onto the slides? I could make screenshots, but that has some drawbacks (ugly, font size, unmaintainable). Do you have some ideas?


  1. copy the code from Visual Studio to PowerPoint
  2. choose "keep original formatting" on the Paste Options icon

If I copy the code from Visual Studio directly into PowerPoint, using Paste Special (and picking RTF), it only does some of the formatting.
Here is how I got it to do all the formatting.

  1. Copy the code in Visual Studio. (Ctrl+C)
  2. Open a new Word document and do a paste. (Ctrl+V)
  3. Re-select the code in Word and copy it again. (Ctrl+A, Ctrl+C)
  4. In PowerPoint, do a Paste Special, as "HTML Format". (Ctrl+Alt+V)