I need to write a report which may contain some Java code pieces. I need the code to appear colored and line numbered. How can I do this ?
Go to the Insert tab, click the Object drop-down arrow, and pick “Object.” On the Create New tab, select “OpenDocument Text” as the Object Type. Click “OK.” A new Word document will open for you to insert your code or command.
To format your whole script: Open the required file. Go to Source | Format Document or press Ctrl+Shift+F.
Go to http://hilite.me/ and copy from the preview pane directly to word (tested with MS Word2007). Supports line numbering, but not well. Quite good for snippets.
One way is to copy & paste directly from Eclipse. It preserves all the color formatting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With