Copying code into word document and keeping formatting [closed] Copying code into word document and keeping formatting [closed] python python

Copying code into word document and keeping formatting [closed]


After trying every method I still had problems then came across this!, basically copy and paste your code and select what language it is (e.g. python, java, ...), and it will kick out the formatted and coloured version ready to be pasted into word :-)

Code to Word and keep formatting


To fix this, instead of directly copying and pasting, use Insert -> Object -> OpenDocument Text. The second option is to create a style for your code.