Pasting source code in word 2007

pdeva picture pdeva · Nov 11, 2008 · Viewed 11.2k times · Source

If i try to paste source code in word 2007 the spacing between the lines seems to get messed up as all new lines are spaced way apart compared to a programming text editor.

Can somebody tell me how to paste source code in word 2007 preserving the formatting and the spacing between lines?

Answer

RuntimeException picture RuntimeException · Nov 11, 2008

Try your IDE's (or editor's) "Export to Clipboard as HTML" or "Export to clipboard as RTF" function. Then paste in Word. Guess it should work. It works on Outlook (it even preserves the syntax coloring)