Jeff Bloom
Jeff Bloom

Reputation: 1286

How can I best display code samples in Word 2007?

I would like the code samples to have line numbers, a border, a background color, and be in courier. The code samples should be able to span pages, so a text box may not be the best solution. Is there a style sheet available for doing this?

Upvotes: 3

Views: 1316

Answers (3)

RBarryYoung
RBarryYoung

Reputation: 56715

Are you using Visual Studio? If so, then you should just be able to cut & paste it from the VS-IDE to word. Since the VS-IDE code Copy is in rich-text form, Word will preserve the formatting when it is pasted in. I do it this way all the time (including with SQL) and it works far better than anything else that I have come up with.

(If you're not using Visual Studio, then sorry, I do not know.)

Upvotes: 3

Ape-inago
Ape-inago

Reputation: 1866

paste -> special -> unformatted text ?

Upvotes: 0

Cdsboy
Cdsboy

Reputation: 730

While its not the best way to do things, one popular approach is to just take a screen shot of your window in your favorite editor and embed the image in the word document.

Upvotes: 0

Related Questions