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

前端 未结 15 1589
南笙
南笙 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: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.

提交回复
热议问题