Hey guys!
I had the same problem, go to file -> Get Add-ins search for: Easy Code Formatter
It'll do the job :D
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Does anyone know a way to display code in Microsoft Word documents that preserves coloring and formatting? Preferably, the method would also be unobtrusive and easy to update.
I have tried to include code as regular text which looks awful and gets in the way when editing regular text. I have also tried inserting objects, a WordPad document and Text Box, into the document then putting the code inside those objects. The code looks much better and is easier to avoid while editing the rest of the text. However, these objects can only span one page which makes editing a nightmare when several pages of code need to be added.
Lastly, I know that there are much better editors/formats that have no problem handling this but I am stuck working with MS word.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Hey guys!
I had the same problem, go to file -> Get Add-ins search for: Easy Code Formatter
It'll do the job :D
There are a number of third-party plugins that can be used to display code snippets in Word with syntax highlighting. One popular plugin is called "CodeHighlighter".
I couldn't find this plugin. Could you please post a link to it?
Dear marcuslki,
Good day! Thank you for posting to Microsoft Community. We are happy to assist you.
There are a couple of ways to display code snippets in MS Word preserving format and syntax highlighting:
Method 1: Using the "Keep Source Formatting" option
This method will preserve the formatting of the code, including the syntax highlighting. However, it can be time-consuming to paste multiple code snippets in this way.
Method 2: Using a third-party plugin
There are a number of third-party plugins that can be used to display code snippets in Word with syntax highlighting. One popular plugin is called "CodeHighlighter".
To use CodeHighlighter:
CodeHighlighter will insert the code snippet into the document with the appropriate syntax highlighting.
Method 3: Using a screenshot
If you are unable to use either of the above methods, you can take a screenshot of the code snippet in your code editor and insert the screenshot into the Word document.
To take a screenshot:
To insert the screenshot into the Word document:
The screenshot will be inserted into the Word document.
Thank you for your precious time. Have a nice day.
Regards,
Microsoft Community