0

new to programming here. What is the best way to use Microsoft Word to write code?

Is there some sort of code editor built in? What about html?

I have already tried asking around and didn't see anything on this internet site about it.

n8dog
  • 9
  • 1
  • 3
  • 3
    Don't use Word. It's a word processor not a text editor. Use something like [Sublime Text](http://www.sublimetext.com/) or [Atom](https://atom.io/). With one of those you'll get proper syntax highlighting and there are a lot of plugins to make your coding experience better. – Sam Nov 19 '15 at 23:04
  • 3
    You didn't see anything because Word is not used for programming. It depends on what programming language you want to use whether to use a text editor (Notepad++, Vi) or some IDE (Eclipse, Visual Studio). – dakab Nov 19 '15 at 23:13

2 Answers2

3

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:

  1. go to "insert" tab, click "object" button.
  2. choose "OpenDocument Text" which will open a new embedded word document
  3. copy and paste your code from Visual Studio / Eclipse inside this embedded word page
  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?

However, if you want to write code, from scratch, then you should use a text editor application such as Eclipse, Notepad++ ,Visual Studio etc.

--Just trying to help--

Community
  • 1
  • 1
0

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). But I'm not a real programmer. https://msdn.microsoft.com/en-us/library/office/ff604039(v=office.14).aspx

Guest
  • 1
  • 1