如何在 Word 2007 中最好地显示代码示例?
我希望代码示例具有行号、边框、背景颜色,并且采用快递格式。 代码示例应该能够跨页面,因此文本框可能不是最佳解决方案。 有可用的样式表来执行此操作吗?
I would like the code samples to have line numbers, a border, a background color, and be in courier. The code samples should be able to span pages, so a text box may not be the best solution. Is there a style sheet available for doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您使用的是 Visual Studio 吗? 如果是这样,那么您应该能够剪切和删除 将其从 VS-IDE 粘贴到 word。 由于 VS-IDE 代码复制采用富文本格式,Word 将在粘贴时保留格式。我一直这样做(包括使用 SQL),它的效果比我使用的任何其他方法都要好跟上。
(如果您没有使用 Visual Studio,那么抱歉,我不知道。)
Are you using Visual Studio? If so, then you should just be able to cut & paste it from the VS-IDE to word. Since the VS-IDE code Copy is in rich-text form, Word will preserve the formatting when it is pasted in. I do it this way all the time (including with SQL) and it works far better than anything else that I have come up with.
(If you're not using Visual Studio, then sorry, I do not know.)
虽然这不是最好的方法,但一种流行的方法是在您最喜欢的编辑器中截取窗口的屏幕截图,并将图像嵌入到 Word 文档中。
While its not the best way to do things, one popular approach is to just take a screen shot of your window in your favorite editor and embed the image in the word document.
粘贴-> 特别-> 无格式文本?
paste -> special -> unformatted text ?