Code Snippets

Associate
Joined
6 Dec 2008
Posts
28
Hi guys,

I am currently finishing my report for university, and I would like to add code snippets and talk about them in the report.

Are there any good tools or techniques that will allow me to do this and insert the snippets of code into word 2007?

thanks in advance
 
Just copy and paste them? Why do you want a screen shot simply containing code.
 
Using Visual Studio 2008 / Word 2007 you can keep syntax highlighting and formatting - imagine it's the same for older versions.
 
When I've needed to use a code snippet I just copied the code from Visual Studio into a textbox. Formatting should be kept the same (unless you've played around with default settings in your options).

If copying into word does indeed strip the formatting, if you go to Words options screen->Advanced->"Cut, Copy and Paste". The drop-downs there should help you out.

Having it in a textbox gives it a nice border, the ability to move it to wherever you want (providing you change its layout properties) and you can add a caption using the referencing tab at the top.

Hope that helps :)
 
I normally code in Notepad++ so do a screen shot of the code and dump that into Word - not the most glamourous look but works for us people without Visual Studio :)
 
I normally code in Notepad++ so do a screen shot of the code and dump that into Word - not the most glamourous look but works for us people without Visual Studio :)
I've done this before, I'd also printed from notepad++ into PDF with colour which can work well, especially when you have 100 pages of code! :eek:
 
I normally code in Notepad++ so do a screen shot of the code and dump that into Word - not the most glamourous look but works for us people without Visual Studio :)

Recent versions come with NppExport which can give you colour support when you copy.

Plugins > NppExport > Copy HTML to Clipboard (it copies to the clipboard AS HTML, so you can use it on any text).
 
Back
Top Bottom