I have to write some documents that will include source code examples. Some of the examples will be written from the IDE, and others would be written in place. My examples a
You can using Plugin Syntax Highlight in Ms.Word https://store.office.com/syntax-highlighter-WA104315019.aspx?assetid=WA104315019 . i follow that step and it's work
This is related to this answer: https://stackoverflow.com/a/2653406/931265 Creating an object solved all of my problems.
Insert > Object > Opendocument Text
This will open a document window, paste your text, format it how you want, and close it.
The result is a figure. Right click the object, and select 'add a caption'.
You can now make cross references, create a table of figures.
There is an easy way if you want simple code formatting.
Then content mixer add will open automatically and you can copy paste your code in there and click on "Insert" to insert it in word doc.