Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My problem: want to copy hundreds of lines of programming codes to a Microsoft Word 2010 document. (make some sort of documentation)

I've tried the method described in this question, to copy and paste programming codes to Microsoft Word 2010 document. The method is : Insert -> Object -> OpenDocument Text.
This worked perfectly and I liked it.

But there's one thing it can't do, it is when the code exceeds the size of one document page. It can't show codes longer than one page. The code can't be separated in two different pages.

Do you have a better solution to this problem ?

share|improve this question
    
Yes, don't use an embedded object for that purpose. I honestly don't know why so many people upvoted for the answer you linked to (and i write lot's of technical documents containing source code). What is your pain that you do not want to simply copy'n'paste the code into your document? Perhaps people don't know about setting deliberate page breaks (which prevents your source code being pushed to other pages when you edit/write some other text), or something, so that they need to come up with terrible crutches... –  elgonzo Nov 16 '13 at 17:33
add comment

1 Answer 1

up vote 3 down vote accepted

Inserting an object is a very bad way of pasting code into a Word document. An inserted object cannot span more than one page.

It is much more effective to just copy the text from the source code, then use the Paste Keep Formatting option in Word2010. You may find that your source code editor doesn't pass the formatting information, in which case you will have to add it yourself.

share|improve this answer
    
I agree. Word will accept HTML or RTF formating. –  surfasb Nov 16 '13 at 21:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.