Editing HTML in Dreamweaver > Cleaning up Microsoft Word HTML |
Cleaning up Microsoft Word HTML
In Dreamweaver, you can open or import documents saved by Microsoft Word as HTML files, then use the Clean Up Word HTML command to remove the extraneous HTML code generated by Word. The code that Dreamweaver removes is primarily used by Word to format and display documents in Word and is not needed to display the HTML file. Retain a copy of your original Word (.doc) file as a backup, because you may not be able to reopen the HTML document in Word once you've applied the Clean Up Word HTML feature. The Clean Up Word HTML command is available for documents saved as HTML files by Word 97 or later.
To clean up Word HTML:
1 | In Microsoft Word, save your document as an HTML file. |
2 | Open the HTML document in Dreamweaver using either of the following methods: |
Choose File > Import > Import Word HTML and select a file to open. | |
Dreamweaver opens the file and then automatically opens the Clean Up Word HTML dialog box. | |
Choose File > Open and select a file to open. | |
An HTML Corrections log file is automatically generated if Warn when Fixing or Removing Tags is selected in HTML Rewriting preferences. This is not part of the Clean Up Word HTML feature. Click Continue to exit the dialog box. Then, in Dreamweaver, choose Commands > Clean Up Word HTML. | |
3 | With either of these methods, there may be a slight delay while Dreamweaver attempts to determine which version of Word was used to save the file. If Dreamweaver is unable to determine this, select the correct version using the pop-up menu. |
4 | Choose which options the Clean Up Word HTML feature should use. The Basic tab displays the following options: |
Remove all Word Specific Markup removes all Word-specific HTML, including XML from html tags, Word custom meta data and link tags in the head of the document, Word XML markup, conditional tags and their contents, and empty paragraphs and margins from styles. You can select each of these options individually using the Detailed tab. |
|
Clean up CSS removes all Word-specific CSS, including inline CSS styles when possible (where the parent style has the same style properties), style attributes beginning with "mso," non-CSS style declarations, CSS style attributes from tables, and all unused style definitions from the head. You can further customize this option using the Detailed tab. | |
Clean up <font> Tags removes HTML tags, converting the default body text to size 2 HTML text. | |
Fix Invalidly Nested Tags removes the font markup tags inserted by Word outside the paragraph and heading (block-level) tags. | |
Set Background Color allows you to enter a hexadecimal value to set the background color of your document. If you do not set a background color, your Word HTML document will have a gray background. The default hexadecimal value set by Dreamweaver is white. | |
Apply Source Formatting applies the source formatting options you specify in HTML Format preferences and SourceFormat.txt to the document. | |
Show Log on Completion displays an alert box with details about the changes made to the document as soon as the cleanup is finished. | |
5 | Click OK. |
Depending on the size of your document and the number of options selected, it may take several seconds to complete the cleanup. The preferences you entered are automatically saved as the default Clean Up Word HTML settings. | |