How to View HTML Source Code in Word

How to View HTML Source Code in Word
Page content

If you are building a website and an image is not appearing as you think it should or a link is broken, viewing the HTML code can help you find mistakes or inaccurate information. Another reason might be that you want to figure out how someone else did something, such as a cool font, text effect or interesting graphics.

While Word might not be your go-to application for all things HTML, you may want to rethink your stance once you find out how easy it is to view source codes using your handy dandy Word application.

HTML Codes in Word 2003

The way to get the information you need into Word before viewing the HTML code will greatly depend on which version of Word you are using. Let’s start with Word 2003 (these steps should also work in earlier versions of Word).

Start by selecting the text, graphic or other item for which you want the HTML codes with your mouse, and then copy your selection. Paste this data into a blank Word document. Go to the File menu and select Save as Web Page. Give the Word document a name and save it anywhere you like.

You don’t need to close out of Word or even close this document. From right where you are, go to the View menu and select HTML Source. The Microsoft Script Editor will open, showing you the html code of your entire Word document.

Article Image

HTML Source in Word 2007 and 2010 (sort of)

If you are working in Word 2007 or 2010, things are a little bit different. Microsoft has removed the internal link from Word to Microsoft Script Editor in these versions. Instead, you will need to add a Web Page Preview button to the QAT (Quick Access Toolbar).

To do so, click the dropdown arrow beside the QAT and select More Commands. The Word Options dialog will open. In the Choose Commands From box, select Commands Not in the Ribbon. Select Web Page Preview from the list of commands, and then click the Add button.

When you use Web Page Preview, the document will open in your default web browser. You will then need to use your browser’s method of viewing HTML code, rather than viewing it directly in Word. If you are using Internet Explorer or Firefox, click View on the toolbar, and then click Source.

Article Image

An additional window opens containing the html code of your Word document.