How to view the HTML source code in Microsoft Word?
Using Microsoft Word, the document can be saved as a web page, but word does not support the feature which enables the user to view the source code in the latest versions.
Microsoft Word 2007, 2010, and later
In the latest version of the Microsoft word, there is not any option to view html source code, but the html source code can be seen by opening the HTML document in any browser.
Viewing the code is possible in the browser but when the user wants to make changes to the HTML source code, like editing the code or linking some web pages, etc., then using the text editors or HTML editor is the best choice with the usage of HTML or text editors to modify the html document.
Microsoft Expression Web provides a simple user interface to edit the document and is open source. The users usually prefer using Microsoft word to edit the html code because of the advantage that in word, there is an interface called WYSIWYG ("what you see is what you get – this means the word shows the document how exactly it looks when it is printed). But many html editors are also providing WYSIWYG interface.
Microsoft Word 2003
Microsoft Word 2003 can view the HTML source code.
Follow the below steps to view HTML source code using Microsoft word.
- First, select the content like text, pictures, or any other data you want to create the HTML code.
- After selecting the data, please copy and paste them into the blank word document.
- Click on the "File" menu, and in that, select "Save as Web Page" now name the word document and save it in your device at your preferred location.
- Go to the "View" menu which is at the right side of the File menu. In the view menu, click on "HTML Source".
- Finally, the html source code of the entire document you have done is seen in the Microsoft Script Editor, as shown in the figure below.

How to view HTML source code in Microsoft word 2007 and 2010 versions?
Microsoft word has made many changes to these versions compared to the 2003 version. In the 2007 and 2010 versions of word, remove the Microsoft Script Editor. So, to view the html source code add a Web Page Preview button to the Quick Access Toolbar (QAT).
But this process is viewing the HTML source in words 2010 and 2007.
The steps for adding the web page preview in word:
- Click on the dropdown arrow in the QAT bar in the word, as shown below. In that, click on the "More Commands" option.

- Select "Choose Commands From" from the dialog box which pops up, then select "Commands Not in the Ribbon".

- Select "Web Page preview" from the command list and click on the "Add" button.

When you do the process mentioned earlier, that is, by adding the Web Page Preview option, the word document will open in the web browser that is set as default in the user's computer. Now use the browser's process to view the HTML code.
This method opens the html source code file in the browser rather than in word directly. For example, if you use Internet Explorer or Firefox as your browser, select "View" on the toolbar and select the "Source" option, as shown in the figure below.

Then an extra window is opened, which contains the html code written in Microsoft Word.