Well - just press the "Print Screen" button on your Keyboard (or use any kind of Snipping Tool)
- to capture the screen image (if the whole code fits your screen) and then copy it to the Word document
If it does not fit in your wholes creen
- Open Paint brush application
- "Divide" the "snipping"/Capturing of the code into few parts (as the # of times it fits your screen: )
- Snip/Capture what is currently seen on screen
- Paste it into PaintBrush(see "snipping code1.png")
- Scroll Matlab's Editor to the next part of the code that was not snipped yet
- Snip again
- Enlarge the Paint Brush image (File/ Properties) (See "snipping code2.png" + "(see "snipping code3.png")
- Pase the new part of the code and align it with the previose section (see "snipping code4.png" where the 2 snipping are emphesized)