Viewing the HTML Code of a Word Document

Written by:  • Edited by: Michele McDonough
Updated Apr 29, 2011
• Related Guides: Microsoft Word | HTML | Internet Explorer

If you are creating or editing a webpage or otherwise working with HTML, there are times when it is helpful to view the HTML source codes. This tutorial will show you how to use Microsoft Word to view HTML codes quickly and easily.

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.

Article Image
click to enlarge
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
click to enlarge

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
click to enlarge

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


Comments

Showing all 8 comments
 
Bob Jun 13, 2011 12:49 AM
Use an HTML editor
Save as HTML, then open the HTML file in a WISIWYG web editor. There are affordable and free ones. Then you can edit and immediately see, more or less, what it will look like, depending on how good the editor is.
Anonymous Jun 10, 2011 7:41 AM
What about 2010?
If you want to fiew your word document as a website, save your file by pressing "save as" and select "webpage" instead of "word-document". Also, don't forget to set ".html" begind the name of your document (usually "index.html"). Than just simply open it :)

And to fiew the sourse code of your word document follow the exactly same steps as above. Than right klick on the file and select "open with" and choose notepad or notepad++. And there you have your sourse code!

I hope I have helped you ;)
Debby Roseman Apr 29, 2011 11:55 AM
What about 2010?
Any idea how to do this in 2010? It won't open in my browser, just pops open in word.
kalai Dec 6, 2010 5:41 AM
hi
how to convert word to html with sourse code
Bill May 16, 2010 3:22 PM
???
I was hoping that by doing this, I could cut and paste from the source from the Note Pad. No such luck. Anyadvice?
Manisha Apr 11, 2010 1:32 AM
Ok
umm...the html code is tooo long and high fi..! the text is barely 1/4th page but html code goes upto 2 pages. not happening
Sam Dec 6, 2009 9:37 PM
Very good
Hi Tricia
It works well !
Thank you.
Sam
jojo Aug 11, 2009 1:49 PM
html codes
not just ALT-F9?
 
blog comments powered by Disqus
Email to a friend