Copy/Paste source code from Eclipse to Microsoft Word

less than 1 minute read

Today I wanted to copy and paste a piece of code from Eclipse Indigo to Microsoft Word 2007 and keep the syntax highlighting. In some cases it worked but in some other not. After searching in the webI found that if the area you want to copy has folded code in it, the syntax highlight will not be preserved (picture 1)

code fold in Eclipse

So before you start copying and pasting from Eclipse to Microsoft Word unfold any part of the code you want to copy (picture 2)

unfold Code in Eclipse

Leave a Comment