Sams Teach Yourself StarOffice® 5 for Linux in 24 Hours

ContentsIndex

Hour 22: Creating Internet Documents with StarOffice

Previous HourNext Hour

Sections in this Hour:

 

Working with Web Documents


StarOffice enables you to view and link to Web documents, but it also enables you to create them. New Web documents can be created from existing Web documents that you download, or they can be started from scratch with nothing but an idea.

Caution - If you want to use downloaded pages as the basis for your own Web pages, ask for permission and check the legal statements on the site. Generally it's best to learn from other sites--even studying the HTML code from their pages--but to create your own Web page from scratch.

Saving Existing Documents for the Web

Hour 5, "Importing and Exporting StarOffice Documents," describes how you can use the Save As feature of StarOffice to export HTML documents for use on the Web or as an interchange format for others who aren't using StarOffice.

Note - HTML--HyperText Markup Language --is a tagging system used to create documents for display on the Web. It's a simple format, but it's tedious to enter the codes by hand.


Although all the features of a StarOffice document can't be converted to HTML for Web display, the primary ones can. Saving an existing document in HTML format is a quick and easy way to create a Web page. Tables, graphics, and all standard text formatting is included in the exported Web page.

To export a document in HTML, follow these steps:

1. Open an existing StarOffice document.

2. Choose Save As... from the File menu.

3. In the drop-down list of file formats, select HTML. (See Figure 22.15.)

Figure 22.15
Select HTML as the file format in which to save your existing StarOffice documents for use on the Web.

4. Enter a new name for the file (html is added automatically).

5. Choose OK.

6. Reopen the newly-saved HTML file in StarOffice or in another browser to see how well the formatting converted to HTML.

Tip - Presentations and spreadsheets can also be saved in HTML format for immediate viewing in a Web browser; use the preceding procedure.

Creating New HTML Documents

If you don't already have a document prepared that you want to move to the Web but you know that the Web is the target for the document that you want to create, the best option is to create it from the beginning as an HTML document. That way, you'll know how it will look in a browser when you're finished.

StarOffice enables you to create native HTML documents. To start a new HTML document, select New from the File menu, and then select HTML document. You can also choose New HTML Document from the StarOffice Desktop, or click the Start menu and choose More, and then HTML document.

A new blank document appears that looks similar to the word processing documents that you're familiar with. However, you'll see that the menus and toolbars are slightly different when you create an HTML document.

Create a small HTML document now and see where the differences lie. Use the following steps:

1. Enter a headline on the first line of the new document.

2. Enter a paragraph of descriptive text.

3. Enter three bullet items after the paragraph. If you start each line with a hyphen, StarOffice converts the hyphens to bullets.

4. Choose Picture from the Insert menu and pick a graphics file to insert.

Note - You cannot use the Image Editor to create an image within an HTML document. The image must exist in a separate file.


Your file will look somewhat similar to the one in Figure 22.16.

Figure 22.16
An HTML file with a few lines of text and a graphic included.

Now try the following:

  • Click in the headline to place the cursor there, and then click on the drop-down list of paragraph styles in the Object toolbar and choose Heading 1. The text of the headline changes to a headline font.

Caution - Remember that the headline might look different in another browser if you use this document on the Web. The browser settings determine, for the most part, how a document looks; StarOffice can't control that in all cases.


  • Click and drag to select all the bulleted lines, and then click on the Numbering icon in the Object toolbar (see Figure 22.17).

  • Click on the figure in the document to select it, and then try to drag it to another location on the page. It returns to its original location. Basic HTML tags that you're using here don't allow graphics to be located as precisely as a word processor does.

Figure 22.17
Choose the Numbering icon on the Object toolbar to change selected paragraphs to a numbered list.

  • With the figure selected, press the right mouse button and move down to the Wrap item. Notice that several of the options are gray--not available (see Figure 22.18). This reflects the more limited formatting capabilities of HTML.

Figure 22.18
The Wrap submenu doesn't include as many available options when creating an HTML document.

Now--for the really startling part of this exercise--choose HTML Source from the View menu. The HTML codes that StarOffice is creating for you are displayed (see Figure 22.19).

HTML keywords and automatically generated information are shown in red text. You can directly edit the HTML source in this window--if you know what you're doing. When you close this window, StarOffice interprets whatever changes you've made and redisplays the document as it will appear in a browser.

Figure 22.19
The HTML Source window shows you the HTML codes for the HTML document that you are creating.

For example, if you locate the IMG tag in the HTML Source window, you can change the name of the graphic file. If you enter a name that cannot be found, the HTML code is accepted but StarOffice shows a small box that says Read Error when you return to the browser view, just as any browser might if an error occurred reading a graphics file.

To return to the browser view of the HTML document, choose HTML Source from the View menu.

Adding Other HTML Elements

Using StarOffice to create the home page for your corporation is not recommended because the editing and graphics tools aren't sophisticated enough to make a really nice looking site. For creating basic Web pages or making other documents available on the Web, however, StarOffice is great.

One reason that StarOffice isn't perfect for creating other Web pages is the limited set of features. Some HTML features that many people like to use, such as frames and client-side image maps, cannot be added using automated tools when you create an HTML page in StarOffice (although they are supported when viewing Web pages that you download into StarOffice).

The following list shows some features that you can include in your StarOffice HTML documents:

  • Horizontal Lines --Insert a horizontal line (HTML tag <HR>) by selecting Horizontal Line... from the Insert menu. A dialog box appears (see Figure 22.20) in which you can select from many different horizontal rules.

Figure 22.20
Insert a horizontal rule in an HTML document from the Insert Horizontal Line dialog box.

Note - Only the first choice listed in the dialog box inserts a regular <HR> tag. The other choices insert an <IMG> Tag with a line-shaped graphic. This type of rule does not appear (or at least doesn't look good) if users turn off graphics in their browser.


  • Tables--Complete HTML table functionality is provided in StarOffice. Choose Table from the Insert menu. With the cursor placed in the table, or with one or more table cells selected, the Format menu includes all the formatting options for HTML tables.

  • Javascript--You can insert Javascript into a Web page by selecting Script... from the Insert menu. The Insert Script dialog box appears (see Figure 22.21); here you can either type in the actual script or enter an URL for the script (this is normally a file on your Linux system where you created the script).

Figure 22.21
Javascripts can be included in your HTML pages using the Insert Script dialog box.

  • Hyperlinks--Because of the importance of hyperlinks in an HTML documents, Hyperlink is included as a separate item on the Insert menu when you are creating an HTML document.

  • Select the text that you want to link and choose Hyperlink from the Insert menu. The dialog box that appears is the same as the Hyperlink tab of the Character dialog box.

  • Comments--HTML code, as you viewed it in the HTML Source window, can include comments that are not seen when using a browser to view the HTML page. They are only visible when viewing the HTML source text. (These comments are similar to comments in a programming language).

  • To insert a comment in your HTML page, choose Note... from the Insert menu. In the Insert Note dialog box (see Figure 22.22), enter the text that you want to include as a comment.

    You can view the comment by opening the HTML Source window. Comments are shown between special characters that identify them as comments. For example


<!----This table needs to be updated before end of the year.--!>

Figure 22.22
The Insert Note dialog box inserts a comment in the HTML code. None of the text you enter is visible in a browser.

Caution - HTML includes a tag called <NOTE>, which inserts a visible, indented comment similar to this one. Don't confuse this with the use of the term Note in StarOffice. A StarOffice Note is really an HTML Comment.


Sams Teach Yourself StarOffice® 5 for Linux in 24 Hours

ContentsIndex

Hour 22: Creating Internet Documents with StarOffice

Previous HourNext Hour

Sections in this Hour: