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?
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)
The problem is that each line is a paragraph, and often in Word, paragraphs have a certain amount of Space Before. If you choose a style that has 0 space before, and 0 space after, it should look fine.
As already mentioned, it's because of the paragraph spacing. Either chose a style with no spacing, or select the text and format paragraph and set the before and after spacing to 0. This was easy with earlier versions, but is presumably complicated now we have ribbon controls. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With