如何在 Word 2007 中最好地显示代码示例?

发布于 2024-07-23 06:47:53 字数 83 浏览 5 评论 0原文

我希望代码示例具有行号、边框、背景颜色,并且采用快递格式。 代码示例应该能够跨页面,因此文本框可能不是最佳解决方案。 有可用的样式表来执行此操作吗?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

温折酒 2024-07-30 06:47:53

您使用的是 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.)

思念绕指尖 2024-07-30 06:47:53

虽然这不是最好的方法,但一种流行的方法是在您最喜欢的编辑器中截取窗口的屏幕截图,并将图像嵌入到 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.

放血 2024-07-30 06:47:53

粘贴-> 特别-> 无格式文本?

paste -> special -> unformatted text ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文