Does anyone know a way to display code in Microsoft Word documents that preserves coloring and formatting?
(有谁知道一种在Microsoft Word文档中显示可保留颜色和格式的代码的方法?)
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.
(最后,我知道有更好的编辑器/格式可以解决此问题,但是我仍然坚持使用MS word。)
ask by Lawrence Barsanti translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…