Working with hyperlinks

From Wiki
Jump to navigationJump to search


When you type text (such as a website addresses or URL) that can be used as a hyperlink, and then press the spacebar or the Enter key, Writer automatically creates the hyperlink and applies formatting to the text (usually a color and underlining). If this does not happen, you can enable this feature using Format > AutoCorrect > AutoCorrect Options and selecting the URL Recognition option.

If you do not want Writer to convert a specific URL to a hyperlink, choose Edit > Undo Insert from the menu bar or press Control+Z immediately after the formatting has been applied.

You can also insert hyperlinks using the Navigator and the Hyperlink dialog, and you can modify all hyperlinks using the Hyperlink dialog, as described in this section.

Tip.png To change the color of hyperlinks, go to Tools > Options > OpenOffice.org > Appearance, scroll to Unvisited links and/or Visited links, select the checkboxes, pick the new colors and click OK. Caution: this will change the color for all hyperlinks in all components of OpenOffice.org—this may not be what you want.

In Writer and Calc (but not Draw or Impress), you can also change the Internet link character style or define and apply new styles to selected links.


Documentation note.png Hyperlinks between documents can be set as relative or absolute, using the Save URLs relative to option in Tools > Options > Load/Save > General. Relative linking is only possible when the document you are working on and the link destination are on the same drive, and you need to create the same directory structure on your hard disk as will apply on the destination website. OOo uses absolute path names internally, so when you move your mouse cursor over a hyperlink, the tooltip displays the absolute reference even when it is set to be a relative link.

Inserting hyperlinks using the Navigator

The easiest way to insert a hyperlink to another part of the same document is by using the Navigator:

  1. Open the document containing the items you want to crossreference.
  2. Open the Navigator (by clicking its icon, choosing View > Navigator, or press F5.
  3. Click the arrow next to the Drag Mode icon, and select Insert as Hyperlink.
  4. In the list at the bottom of the Navigator, select the document containing the item that you want to cross-reference.
  5. In the Navigator list, select the item that you want to insert as a hyperlink.
  6. Drag the item to where you want to insert the hyperlink in the document. The name of the item is inserted in the document as an active hyperlink.
File:CH3 Hyperlinks Navigator.png
Navigator dialog showing Hyperlink details.

You can also use the Hyperlink dialog to insert and modify hyperlinks within and between documents

Inserting Hyperlinks using a Dialog Box

You can also insert and modify links using the Hyperlink dialog. To display the dialog, click the Hyperlink icon File:HyperlinkIcon.png on the Standard toolbar or select Insert > Hyperlink from the menu bar. To turn existing text into a link, highlight it before opening the Hyperlink dialog.

File:Hyperlink-dialog.png
Hyperlink dialog showing details for Internet links.

On the left hand side, select one of the four types of hyperlink:

  • Internet: a web address, normally starting with http://
  • Mail & News: for example an email address.
  • Document: the hyperlink points to another document or to another place in the presentation.
  • New document: the hyperlink creates a new document.

The top right part of the dialog changes according to the choice made for the hyperlink type. A full description of all the choices, and their interactions, is beyond the scope of this chapter. Here is a summary of the most common choices used in presentations.

For an Internet type hyperlink, choose the type of hyperlink (choose between Web, FTP or Telnet), and enter the required web address (URL).

For a Mail and News type hyperlink, specify whether it is a mail or news link, the receiver address and for email, also the subject.

For a Document type hyperlink, specify the document path (the Open File button opens a file browser); leave this blank if you want to link to a target in the same presentation. Optionally specify the target in the document (for example a specific slide). Click on the Target icon to open the Navigator where you can select the target, or if you know the name of the target, you can type it into the box.

For a New Document type hyperlink, specify whether to edit the newly created document immediately or just create it (Edit later) and the type of document to create (text, spreadsheet, etc.). For a presentation, Edit now is the more likely choice. The Select path button opens a directory picker.

The Further settings section in the bottom right part of the dialog is common to all the hyperlink types, although some choices are more relevant to some types of links.

  • Set the value of Frame to determine how the hyperlink will open. This applies to documents that open in a Web browser.
  • Form specifies if the link is to be presented as text or as a button.
  • Text specifies the text that will be visible to the user.
  • Name is applicable to HTML documents. It specifies text that will be added as a NAME attribute in the HTML code behind the hyperlink.
  • Event button: this button will be activated to allow OOo to react to events for which the user has written some code (macro). This function is not covered in this book.

Editing hyperlinks

To edit a hyperlink, click anywhere in the link text and then open the Hyperlink dialog box by clicking the Hyperlink icon on the Standard toolbar or choosing Edit > Hyperlink from the menu bar. Make your changes and click Apply. If you need to edit several hyperlinks, you can leave the Hyperlink dialog box open until you have edited all of them. Be sure to click Apply after each one. When you are finished, click Close.

The standard (default) behavior for activating hyperlinks within OOo is to use Ctrl+click. This behavior can be changed in Tools > Options > OpenOffice.org > Security > Options, by deselecting the option Ctrl-click required to follow hyperlinks. If clicking in your links activates them, check that page to see if the option has been deselected.

To change the color of hyperlinks, go to Tools > Options > OpenOffice.org > Appearance, scroll to Unvisited links and/or Visited links, select those options, pick the new colors and click OK.

Documentation caution.png This will change the color for all hyperlinks in all components of OpenOffice.org—this may not be what you want.


In Writer and Calc (but not Draw or Impress), you can also change the Internet link character style or define and apply new styles to selected links.


Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY).