如何将程序打印到 MS Word?
我们有一个项目,教授要求我们用microsoft word打印程序代码。 然而,当我将所有代码粘贴到 MS Word 中时,结果发现它没有着色,那些漂亮的编程字体。它在 Microsoft Word 中看起来非常难看。
我希望它能非常华丽地打印在纸上。 就像我们在记事本++中看到的那样
We have a project, and the professor asked us to print the program codes using microsoft word. however when i pasted all my codes in ms word it turns out that it doesn't have coloring, those nice programming fonts.. It just looks awfully ugly in microsoft word..
I want this to be printed on papers very gorgeously. Like what we see in our notepad++
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
如果您使用的是 Windows,则可以在 Visual Studio 中打开源代码(假设是 C++、C# 或 VB),复制代码并将其粘贴到 Word。
“Visual Studio”到“Word”确实保留格式(颜色和字体)。
If you are on Windows, you can open the source code in Visual Studio (assuming it is C++, C# or VB), copy the code, and paste it to Word.
"Visual Studio" to "Word" does keep the formatting (color and fonts).
当我可以避免时,我不会使用 Word。 它只是不太擅长保持格式,并且不能提供真正好看的打印效果。
I do not use Word for this when I can avoid it. It's simply not very good at keeping the formatting and doesn't provide really good-looking prints.
Microsoft Word 对于代码审查非常方便。 特别是如果您不想花钱购买专门为同行代码审查而设计的工具之一。 每个审阅者都可以在文档中插入他们的评论和/或修改代码。 如果您跟踪更改,则可以查看更改的内容并接受或拒绝更改。 在审核过程中,您只需循环浏览评论和更改即可。 完成后,您只需将最终产品复制并粘贴回源文件即可。 它胜过必须列出评论列表,破译它们,然后自己合并请求。
编辑:我们使用 Visual Studio。 因此,在源代码和 Microsoft Word 之间进行剪切/粘贴工作正常,除非行长度超过页面大小。
Microsoft Word is very handy for code reviews. Particularly if you don't want to splurge for one of the tools explicitly designed for peer code reviews. Each reviewer can insert their comments and/or modify the code themselves right in the document. If you keep track changes on then you can see what was changed and accept or reject the changes. During the review you only have to cycle through the comments and changes. When you are all done, you can simply copy and paste the final product back into the source file. It beats having to take a list of comments, decipher them and then incorporate the requests yourself.
EDIT: We use Visual Studio. So Cut/Paste between the source and Microsoft Word works fine, except in the cases where the line length exceeds the page size.
如果您有 NppExport 插件,请转到
如果选择导出为 rtf,则在 Microsoft Word 中打开它;如果选择复制,则将其粘贴到 Word到剪贴板
希望这对我有帮助
我在我的 SQL 作业中尝试过它并且它有效
If you have the NppExport Plugin, go to
Then open it in Microsoft Word if you choose export to rtf, or paste it to Word if you choose copy to clipboard
Hope this helps
I tried it for my SQL assignment and it works
我不确定我是否理解这个问题,但如果您问“如何将我的源代码放入 Word 并使其看起来像 Notepad++”,您将需要对 Microsoft Word 自动化进行一些研究。
使用 C# 的 Word 自动化
使用 Word 的 OLE 自动化(文章)
Microsoft Word 自动化课程
I'm not sure I understand the question, but if you're asking "how do I put my source code into Word and make it look pretty like Notepad++," you'll want to do some research into automating Microsoft Word.
Word automation using C#
OLE Automation using Word (Article)
Microsoft Word Automation Class
这看起来似乎很明显,但是您只需从记事本++打印它怎么样?
This may seem obvious, but how about you just print it from notepad++?
Eclipse 做了 decasteljau 所说的同样的事情。
当您从 Eclipse 复制代码,然后粘贴到 Outlook 上时,代码会保持其颜色。
Eclipse does the same thing told by decasteljau.
When you copy code from eclipse, and then you paste on Outlook, the code keeps its colours.