简体   繁体   English

Microsoft Word文字编辑器

[英]Microsoft Word Text Editor

new to programming here. 编程新手。 What is the best way to use Microsoft Word to write code? 使用Microsoft Word编写代码的最佳方法是什么?

Is there some sort of code editor built in? 有内置的某种代码编辑器吗? What about html? html呢?

I have already tried asking around and didn't see anything on this internet site about it. 我已经尝试过四处询问,但在此互联网站点上什么都没看到。

If you have already written code in a programming code editor (Notepad++, Visual Studio, Eclipse etc.) you can put the code in a Word document by following these instructions in Word: 如果您已经在编程代码编辑器(Notepad ++,Visual Studio,Eclipse等)中编写了代码,则可以按照Word中的以下说明将代码放入Word文档中:

  1. go to "insert" tab, click "object" button. 转到“插入”选项卡,单击“对象”按钮。
  2. choose "OpenDocument Text" which will open a new embedded word document 选择“ OpenDocument文本”,这将打开一个新的嵌入式Word文档
  3. copy and paste your code from Visual Studio / Eclipse inside this embedded word page 从Visual Studio / Eclipse复制并粘贴您的代码到此嵌入式word页面中
  4. save and close 保存并关闭

The result looks very nice. 结果看起来非常不错。 Here are the advantages of this method: 这是此方法的优点:

  1. the code keeps its original layout and colors 代码保持其原始布局和颜色
  2. the code is separated from the rest of the document, as if it was a picture or a chart 代码与文档的其余部分分开,好像是图片还是图表
  3. spelling errors won't be highlighted in the code (this is cool !) 拼写错误不会在代码中突出显示(这很酷!)
  4. And it takes only few seconds. 而且只需要几秒钟。

reference : How do you display code snippets in MS Word preserving format and syntax highlighting? 参考: 如何以MS Word保留格式和语法高亮显示代码段?

However, if you want to write code, from scratch, then you should use a text editor application such as Eclipse, Notepad++ ,Visual Studio etc. 但是,如果您想从头开始编写代码,则应使用文本编辑器应用程序,例如Eclipse,Notepad ++,Visual Studio等。

--Just trying to help-- -只是想帮助-

There is of course Visual Basic for Applications (VBA) which you can access from Word and write some smart scripts in it (also you can record scripts/macros). 当然有Visual Basic for Applications(VBA),您可以从Word中访问它并在其中编写一些智能脚本(也可以记录脚本/宏)。 But I'm not a real programmer. 但是我不是一个真正的程序员。 https://msdn.microsoft.com/en-us/library/office/ff604039(v=office.14).aspx https://msdn.microsoft.com/en-us/library/office/ff604039(v=office.14).aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM