Cleaning Up Word HTML


Back in Chapter 4, we learned how you can bring content from Microsoft Word into Dreamweaver with the Paste Special command, which allows you to preserve varying amounts of the formatting from the Word document. By using the Paste Special command, you will get very good results.

There's another way to get content from Word into Dreamweaver, though we don't recommend it (but you might have to deal with it anyway). Word can export its files as HTML documents, which can then be opened in Dreamweaver. The problem is that when Word (and other Microsoft Office applications) saves a document as a Web page, the HTML code created includes lots of excess or Microsoft-specific code that is designed to enable these Web pages to be brought back into Word or Excel more easily, but that most browsers don't need. This excess code can easily bloat the size of a Web page to two or three times the size of a Web page created entirely in Dreamweaver.

Happily, Dreamweaver has the ability to import a Word HTML document and clean up its code. It does this by eliminating Word specific styles, removing nonstandard CSS, getting rid of empty paragraphs, deleting Microsoft-specific XML tags, and more. In short, if you have been given Word documents that were exported to HTML, Dreamweaver has the means to clean them up.

To clean up a Word HTML document:

1.
Open the Word HTML document.

The document appears on the screen.

2.
Choose Commands > Clean Up Word HTML.

The Clean Up Word HTML dialog appears ( Figure 14.14 ). Dreamweaver automatically detects whether the HTML was produced by Word 97/98 or Word 2000 or later.

Figure 14.14. Use the Clean Up Word HTML command to optimize the HTML from Word documents that were exported as Web pages.


3.
Choose to turn on or off any of the options on the Basic or Detailed tabs of the dialog.

By default, all of the options are turned on. We recommend that you leave things this way, unless you know that there are specific options you don't need.

4.
Click OK.

Dreamweaver processes the Word HTML document, then displays a dialog summarizing the results of the process ( Figure 14.15 ).

Figure 14.15. Dreamweaver lets you know the changes it made in the Word document.


5.
Click OK.

The converted document appears in the Dreamweaver document window.

Tips

  • The Paste Special command does a better job of preserving the original formatting and styling of the Word document than the Clean Up Word HTML command.

  • Long Word documents may take more than a minute to complete processing, depending on the size of the document and the speed of your computer.

  • There is a third way to bring Word or Excel documents into Dreamweaver for Windows, but again, we don't recommend it. You can choose File > Import > Word Document or File > Import > Excel Document. After choosing the document you want from an Open dialog, Dreamweaver converts the document and inserts its contents into the current page. Unfortunately, you get approximately the same quality results as you would get if you exported the Word or Excel document to HTML, imported it into Dreamweaver, then used the Clean Up Word HTML command, which is to say, not as good as if you used Paste Special.





Macromedia Dreamweaver 8 for Windows & Macintosh Visual QuickStart Guide
Macromedia Dreamweaver 8 for Windows & Macintosh
ISBN: 0321350278
EAN: 2147483647
Year: 2005
Pages: 239

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net