- Introduction
- Opening and Editing an Existing File Using Code View
- Importing Styled Text from a Document
- Cleaning Up Imported Text
- Summary
- Q&A
- Workshop
- Quiz
- Answers
- Exercise
Importing Styled Text from a Document
What is a website if not a source of information? You need some real content to work with. Right now the default.html file contains whatever text you inserted during Hour 3. The next step is to introduce some real content. In most cases, you will either be provided with or write your own content in some form of word processing software. Your first instinct is probably to cut and paste this content straight into your page. The problem is that word processors attach a large amount of invisible styling code to their documents—code that becomes very difficult to work with after import into an HTML file. To get rid of most of this superfluous code, Expression Web 2 can import this content and translate basic layout and styling for you. It’s not a perfect solution, but it’s far better than cutting and pasting.
In the set of files you downloaded from the book site is a Microsoft Word document called MyKippleHome.doc (see Figure 4.5). Open this document in Microsoft Word and you see a standard document with headings, subheadings, and some text.
Figure 4.5 MyKippleHome.doc as it appears in Microsoft Word.
The next step is to move all this content over to the default.html file and translate the styling to standards-based code. To import the content, you use the File command.
To import the content of the MyKippleHome.doc file into your project, click the Insert File button you just added to the Common toolbar. This opens a standard Select File dialog. Browse to the location where you saved the MyKippleHome.doc file. By default, the Insert File command looks for HTML files. But if you click the Files of Type drop-down menu, you see the program supports a long list of file types including Rich Text Format (.rtf), many different versions of Microsoft Word documents (.doc), Microsoft Excel worksheets (.xls), WordPerfect documents (.wpd), and many more. Simply clicking All Files (*.*) shows you all the available files. Select the MyKippleHome.doc file and click Open.