Software

Word as HTML editor: Is it ready for prime time?

Take a look at how Word 2002/2003's Web editing features have been improved, the pros and cons of creating Web pages with Word, and how Word compares to other HTML editors.


Microsoft Word started out as a simple word processing program, but its capabilities have expanded with each new version. In its last several incarnations, Word has included increased functionality as a desktop publisher and HTML editor. However, Word continues to be an object of scorn and derision in the Web design community—both from purists who write their markup manually in Notepad and those who use dedicated HTML editors, such as Microsoft’s own FrontPage.

Undaunted, Microsoft continues to expand Word’s Web page creation and publishing capabilities. For example, Word 2002 includes better support for cascading style sheets and an option to save HTML documents in filtered HTML format, addressing two common complaints about earlier versions. Word 2003, now in public beta, goes further with support for XML.

I’ll discuss Word’s HTML and forthcoming XML capabilities, compare Word to other HTML editors such as FrontPage, and help you decide whether Microsoft has finally achieved its goal of making Word a viable option for creating Web pages. You may find that Word’s ease of use and almost global availability in the corporate environment make it a smart choice for basic HTML editing.

Making Web pages with Word
Word 2002 offers several ways to create a Web page:
  • You can start from scratch to make a blank Web page. Just click File | New and select Blank Web Page in the New Document pane.
  • You can use the Web Page Wizard, which you’ll find by selecting General Templates under the New Document window’s New From Template section. Next, select the Templates dialog box’s Web Pages tab and double-click the Web Page Wizard icon.
  • You can use one of the Web page templates included on the Templates dialog box’s Web Pages tab.
  • You can save any existing Word document as a Web page by selecting Save As Web Page from the File menu.

Converting several files at once
Word 2002 also offers a Batch Conversion Wizard, invoked from the Other Documents tab in General Templates, which you can use to create multiple Web pages from a group of existing Word documents rather than individually saving each one as a Web page.

The upside of using Word to make Web pages
Regardless of which Word page creation method you choose, you’ll enjoy some advantages over manual coding and using dedicated HTML editors. Hand-coding requires that you learn the markup language, and the process itself can take a lot of time. A single typo can cause your page to display incorrectly. And dedicated HTML editors require that you purchase (or download) and install another piece of software and learn its interface.

Word creates Web pages quickly and easily from within an application that your users already know. Users can convert existing files to display on an intranet in one simple step. Plus, Word displays documents saved with the .html or .htm extensions in its Web Layout view, which gives you a more or less WYSIWYG look at what you’re doing.

Seeing a regular .doc as a Web page
To see a regular Word document (.doc extension) in Web Layout view, you can select that option from the View menu.

Once you’ve created an HTML document, you can easily see how it looks in the browser by selecting Web Page Preview from the File menu. This will display the page in an Internet Explorer window.

If your document contains formatting elements such as text boxes that aren’t supported by HTML, Word will try to convert them to something that comes close. In some cases, however, the unsupported elements will be removed when you save as HTML.

The downside
Given these advantages, why not use Word to create all of your Web pages? Perhaps the biggest reason, and the most common complaint about Word as an HTML editor, is the state of the source code that results when Word creates a page. To illustrate the problem, let’s look at a very simple Web page that I created in both Notepad and Word. Figure A shows the page itself, displayed in the browser.

Figure A
This sample page was created two ways, in Notepad and in Word.


Figure B shows the entire HTML document as created manually in Notepad.

Figure B
This is the HTML document created in Notepad to display the Web page.


Figure C shows about one-third of the document created by Word to display the same Web page.

Figure C
This is just the part of the document created by Word to display the same page.


The manually coded document contains 214 characters; Word’s HTML file contains 4,133. This larger file takes up more room on your Web server and takes longer for browsers to download.

But it’s not just the quantity of the code that gets critics up in arms—it’s also the quality. Word inserts Office-specific markup tags into the HTML documents it creates. This code makes it possible for you to open the document again in Word and use program features to continue editing the document. All you have to do is click the File menu in Internet Explorer and select Edit With Microsoft Word.

As a workaround, Microsoft introduced the HTML filter tool (downloadable for Office 2000 and built into Office 2002/2003), which removes these proprietary tags. To use filtering in Word 2002, select Save As from the File menu and choose Web Page, Filtered in the Save As Type drop-down list. This reduces the file size considerably.

When saved as a filtered file from Word, the source for the Web page above contains 1,046 characters—still far more than the hand-coded document but much cleaner than Word’s original file, which was almost four times as large.

Although Microsoft is slowly moving toward better support for Internet standards, at this time, all browsers may not display Word-created Web documents properly. If you need to create pages that can be used with a variety of browsers, you might find hand-coding or using a less proprietary HTML editor a better choice.

Word attempts to address this issue by including a feature that allows you to optimize your Web pages for specific browsers. To do this, select Tools | Options, click the General tab, and click the Web Options button. On the Browsers tab, you can select different Internet Explorer or Netscape versions and disable features not supported by these browsers. In addition, you can use the Pictures tab to set the monitor resolution for which your pages will be optimized (800x600 is the default).

In any event, you should always check the code in the browser(s) you expect visitors to use.

Word’s more advanced Web page creation features
Earlier versions of Word were useful only for creating relatively simple Web pages. You could insert graphics, hyperlinks, and forms, and use tables and lists, but if you wanted to use frames or apply style sheets, you were out of luck. Current versions of Word support both of these features; in fact, including complex elements such as frames is now a simple matter of pointing and clicking. As shown in Figure D, you can select vertical or horizontal navigation frames when creating a page with the Word 2002 Web Page Wizard.

Figure D
The Web Page Wizard makes it easy to insert complex elements such as frames.


Word also makes it easy to dress up the appearance of your Web pages by selecting from predefined themes (collections of backgrounds, font styles, bullet types, and other graphical elements), as shown in Figure E.

Figure E
Word’s themes make it easy to dress up the appearance of Web pages.


Users can select themes when creating Web pages with the wizard, or they can apply themes to existing pages by selecting Themes from the Format menu.

You can attach or remove cascading style sheet (CSS) files from Word Web documents to allow easy formatting changes without having to individually edit each page. To attach a CSS, click Tools | Templates And Add-ins and then click the Linked CSS button. Next, click the Add button and choose the CSS you want. You can attach more than one style sheet, and you can specify the precedence in which multiple sheets are applied by moving them up or down in the list.

Word supports many additional Web page creation features, including:
  • Insertion of sounds and movie files (Media Player or another audio/video player is required).
  • Automatic creation of link bars for navigation (if your Web server runs FrontPage Server Extensions 2002 or SharePoint Team Services).
  • Addition of VBScript, JavaScript, and ActiveX controls to your Web pages, using the Microsoft Script Editor (invoked by clicking Tools | Macro | Insert Script).
  • Addition of Web Discussions to your Web pages so users can attach comments that will be stored on a discussion server (this requires a properly configured server and should generally be used within the intranet, because you probably won’t want to open these capabilities to Internet users).

Publishing your Web pages
One of the best features of recent Word versions is the ability to publish your pages to a Web server that has the proper extensions installed, without having to use an FTP tool. Instead, you can choose Save As Web Page from the File menu and select My Network Places in the left pane. You can then choose a Web site for which you’ve earlier created a network place (such as Mydomain.com) and save the page there.

New Web creation features in Word 2003
In addition to the features I’ve already discussed, which are included in Word 2002, Word 2003 offers several new features for Web page creators who need to keep up with the latest trends for presenting data on the Web.

What’s XML got to do with it?
Word 2003 (the stand-alone program or the version of Word included in Office Professional Edition 2003) incorporates support for creating Web documents that use the Extensible Markup Language (XML). XML tags are used to specify data types within a document (similar to the way in which HTML tags specify formatting). Data can then be sorted or extracted based on these tags.

You can save any document as XML (File | Save As and select XML Document as the file type) in the same way you save a Web page as HTML. You can use Word’s own XML schema—which defines the structure of an XML document—or you can use your own custom schema by attaching it to a document. Word also lets you use Extensible Stylesheet Language Transformation (XSLT) files for defining how XML data is presented. Whenever you save a document in XML format, you can also apply transformation files by checking the Apply Transform box and clicking the Transform button to select the XSLT file.

Single file (encapsulated) Web pages
Word 2003 lets users save Web documents as Single File Web Pages with the .mht or .mhtml extension. Saving a document in this format creates one file that contains everything on the Web page (rather than saving separate files for graphics as when you save in HTML format). The document is a MIME encapsulated HTML file, which can be displayed by IE 4.0 and above or Netscape 4.0 and above. The advantage of this format is that you can easily send an entire Web page as an e-mail attachment or otherwise transfer it all in one piece.

Word vs. dedicated HTML editors
Word is getting better as an HTML editor for those who aren’t too worried about file size and exact compliance to HTML standards. For example, suppose several employees need to create pages for the intranet, where all users who view the pages will be using a current version of Internet Explorer. If you have plenty of disk space on the Web server, Word may be a good choice because it’s likely to be installed on everyone’s system, and using it doesn’t require a steep learning curve.

On the other hand, Word still has a long way to go before it can compete with dedicated HTML editors if you do much Web design, want to design complex sites, or need to support visitors who use different browsers. Let’s look at how Word compares to some popular HTML editors.

Saving graphics in Word Web pages
One interesting difference I’ve noticed between Word and most HTML editors is that you can't save graphics in a typical Word-created Web page in the usual method from the browser (by right-clicking and selecting Save Picture As). Site visitors might find this annoying, but the Web designer might see it as a plus because it makes it more difficult for people to copy your graphics. However, if you “filter” your Word HTML files to a smaller size, the ability to save graphics from a browser again becomes active.

Word vs. FrontPage
One of Word’s key competitors in the Web page editing arena is FrontPage, also a member of the Microsoft Office family. FrontPage has the advantage of using the same toolbar conventions as Word and other Office programs, so it’s easy for Word users to learn. It’s also a genuine WYSIWYG utility; what you see in the interface is pretty much what you see in the browser (even Java applets and animations can be viewed using the Preview function without opening the page in a browser). FrontPage lets users open and work on entire Web sites, not just individual Web pages. You can create SharePoint Team Services sites for collaboration, link to databases, and create and manipulate complex forms.

FrontPage also lets you insert elements such as page transitions and Dynamic HTML (DHTML) effects, as well as Web components such as hit counters and search forms. You can import and export entire sites, and easily edit “in place” on the Web server without downloading pages. FrontPage lets you view and edit the source code easily, switching between the normal (WYSIWYG) view and the HTML code, and you can create .ASP pages and secure pages for e-commerce.

FrontPage also includes site management features that Word lacks, such as the ability to easily move folders and files on the Web server and to generate reports that detail recently added or changed files, problems, workflow status, and usage statistics.

Word vs. other third-party HTML editors
Many Web creation tools are available, ranging from freeware to expensive professional packages that cost hundreds of dollars. Some of the free programs, such as CoffeeCup 9.2, provide several advanced features such as built-in text effects, JavaScripts, and support for style sheets and DHTML. Professional packages such as Dreamweaver from Macromedia ($399) give you powerful tools to build ASP.NET and PHP applications.

Word compares favorably to most freeware programs. I would never suggest that you buy Word if all you want is an HTML editor—that functionality is, and always will be, secondary to its role as the standard word processing application. However, the HTML editing capabilities are a bonus, and if you already use Word for word processing, letting it double as your HTML editor may make sense.

About Deb Shinder

Debra Littlejohn Shinder, MCSE, MVP is a technology consultant, trainer, and writer who has authored a number of books on computer operating systems, networking, and security. Deb is a tech editor, developmental editor, and contributor to over 20 add...

Editor's Picks