Skip to main content.

Web Based Programming Tutorials

Homepage | Forum - Join the forum to discuss anything related to programming! | Programming Resources

How to use HTML 3.2

Chapter 16 -- Converting Existing Documents to HTML

Chapter 16

Converting Existing Documents to HTML


CONTENTS



So far, you've learned just about everything you need to know to create HTML documents from scratch. But what about converting existing documents to HTML? The prospect of having to retype documents and insert the appropriate HTML codes by hand isn't very promising, even for the most experienced HTML wizards.

Fortunately, there are plenty of tools available to convert existing documents to HTML quickly. If you're lucky enough to have your documents in Microsoft Word format, conversion is a snap. However, even if your documents are in plain text, the dirty work of inserting paragraph markers, line breaks, and heading tags can be done automatically by the right tools.

How to Convert Text Files to HTML with HotDog Professional

If you have a lot of plain text files that you need to quickly convert to HTML, one of the best tools available is HotDog Professional. One of the many features of this popular HTML editor is its ability to quickly convert existing text documents to HTML after you select just a few simple options. HotDog Professional automates most of the task, and produces a valid HTML document in mere seconds.

HotDog Professional is available as shareware, and you can evaluate it for free for 30 days. It is well worth a look. You can download a copy from Sausage Software's Web site at http://www.sausage.com.

Tip Sheet

  1. Locate the text file you want to convert to HTML.

    Figure 16.2 :

  2. Launch HotDog Professional and choose Convert to HTML from the Tools menu.

    Figure 16.3 :

  3. In the Text to HTML Converter dialog box, select the appropriate options. You'll almost always want to select the first option, Change one or more blank lines to <P>. Blank lines in text files usually indicate separate paragraphs.

    Figure 16.4 :

  4. The second option concerns the creation of lists. If your text file contains bulleted lists, you can automatically convert them to HTML lists. Choose the type of list you'd like to create, along with the character used in the text file to denote a list item.

    Figure 16.5 :

  5. The second group of options deals with creating headings. If your text file uses single lines of text to separate sections, you can convert them to HTML headings. Select the type of HTML heading you'd like to create. You can choose a separate heading style for the very first line in your text file.

    Figure 16.6 :

  6. You can also leave the entire text file as it is by choosing to convert it to preformatted text. This option also allows you to choose the column width for the resulting HTML file.

    Figure 16.7 :



  7. You have the option of inserting a line break after each line. This is a good idea if your text file contains a number of short lines that should not be converted into paragraphs.

    Figure 16.8 :

  8. When you're done setting the conversion options, click on the Convert Files button.

    Figure 16.9 :

  9. Select the files you'd like to convert. You can choose multiple files by pressing the Ctrl key as you select each one. You can also use wildcard characters to select multiple files. When you're finished, click on the OK button.

    Figure 16.10:

  10. Click on the Accept button to convert your text files to HTML. The conversion happens almost instantly, and HotDog Professional saves the converted files with file names similar to your original text files, except with an .htm extension. By default, HotDog Professional will save the new files in the program's main folder.

    Figure 16.11:

  11. Open your new HTML files with either HotDog Professional or Notepad and make any necessary manual changes, such as inserting a title for the document. Save your changes when you are finished.

    Figure 16.12:

How to Convert Microsoft Word Documents to HTML

Microsoft provides an add-on for Word called Internet Assistant. This powerful set of tools is the perfect vehicle for anyone familiar with Word who also wants to publish HTML documents. Internet Assistant handles all of the HTML coding, allowing you to spend your effort on the documents themselves, and not the coding necessary to make them visible on the Web.

Internet Assistant is available for free, and requires Word 6.0 or later. You can download it from Microsoft's Web site at http://www.microsoft.com/word/fs_wd.htm.

Tip Sheet

  1. Open the Microsoft Word document you want to convert to HTML.

    Figure 16.14:

  2. Choose Save As from the File menu.

    Figure 16.15:

  3. Change the file type in the Save as type list box to HTML. Word will automatically change the file extension to .htm. Click on the Save button to save the file.
  4. Figure 16.16:

  5. Word will automatically convert your document to HTML, adding all of the necessary tags. This process takes only a few seconds, and when it's finished, you'll have a complete HTML document.

    Figure 16.17:

  6. You can see the actual HTML source code by selecting HTML Source from the View menu.

    Figure 16.18:

  7. You can preview the HTML document by choosing Web Browse from the View menu. This will launch Internet Assistant's built-in Web browsing software.

    Figure 16.19:

  8. If you switch back to HTML Edit mode from the View menu, you can insert additional HTML codes and markup by selecting these options from the Insert menu.
  9. When you're finished editing your document, save it once more as an HTML file.