What is the best way to insert source code examples into a Microsoft Word document?

前端 未结 15 1495
南笙
南笙 2020-12-22 16:05

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

相关标签:
15条回答
  • 2020-12-22 16:25

    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

    0 讨论(0)
  • 2020-12-22 16:29

    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.

    0 讨论(0)
  • 2020-12-22 16:32

    There is an easy way if you want simple code formatting.

    1. Open word> Insert tab> click on "Get Add-ins"
    2. search for "Content mixer" 3.click on "Add"

    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.

    0 讨论(0)
提交回复
热议问题