Difference between revisions of "Documentation/OOo3 User Guides/Calc Guide/Hyperlinks and URLs"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Relative and absolute hyperlinks)
 
(12 intermediate revisions by 3 users not shown)
Line 5: Line 5:
 
|NextPage=Documentation/OOo3_User_Guides/Calc Guide/Linking to external data
 
|NextPage=Documentation/OOo3_User_Guides/Calc Guide/Linking to external data
 
}}
 
}}
Hyperlinks can be used in Calc to create spreadsheets that will be used in a web interface or to jump to a different location from within a spreadsheet. This section covers inserting, editing, removing, and using hyperlinks.
+
Hyperlinks can be used in Calc to jump to a different location from within a spreadsheet and can lead to  other parts of the current file, to different files or even to web sites.
  
 
== Relative and absolute hyperlinks ==
 
== Relative and absolute hyperlinks ==
Line 16: Line 16:
 
To change the way that OOo saves the hyperlinks in your file, select '''Tools > Options > Load/Save > General''' and choose if you want URLs saved relatively when referencing the ''File System'', or the ''Internet'', or both.
 
To change the way that OOo saves the hyperlinks in your file, select '''Tools > Options > Load/Save > General''' and choose if you want URLs saved relatively when referencing the ''File System'', or the ''Internet'', or both.
  
Calc will always display an absolute hyperlink. Don’t be alarmed when it does this when you have chosen a relative hyperlink — this 'absolute' target address will be updated if you move the file..
+
Calc will always display an absolute hyperlink. Don’t be alarmed when it does this even when you have chosen a relative hyperlink — this 'absolute' target address will be updated if you move the file..
  
{{Documentation/Note| Make sure that the folder structure on your computer is the same as the file structure on your web server if you save your links as relative to the file system and you are going to upload pages to the Internet.}}
+
{{Note| Make sure that the folder structure on your computer is the same as the file structure on your web server if you save your links as relative to the file system and you are going to upload pages to the Internet.}}
  
{{Documentation/Tip| When you rest the mouse pointer on a hyperlink, a help tip displays the absolute reference, since OOo uses absolute path names internally. The complete path and address can only be seen when you view the result of the HTML export (saving the spreadsheet as an HTML file), by loading the HTML file as Text, or by opening it with a text editor.}}
+
{{Tip| When you rest the mouse pointer on a hyperlink, a help tip displays the absolute reference, since OOo uses absolute path names internally. The complete path and address can only be seen when you view the result of the HTML export (saving the spreadsheet as an HTML file), by loading the HTML file as Text, or by opening it with a text editor.}}
 
+
In the example below, the path is ''D:\My Documents'' for the linked file. That is because the folder both sheets are in is in that directory.
+
 
+
[[Image:CG3Ch9F16.png|thumb|none|500px|''Files on D drive'']]
+
 
+
If we move that folder to the ''H:\ ''drive, the links in Calc will automatically update because we have not changed the location of the files relative to each other. Both files are still in the ''working with multiple sheets'' folder.
+
 
+
[[Image:CG3Ch9F17.png|thumb|none|500px|''Files on H drive'']]
+
 
+
[[Image:CG3Ch9F18.png|thumb|none|500px|''Directory with linked files'']]
+
 
+
[[Image:CG3Ch9F19.png|thumb|none|500px|''Updated links on H drive'']]
+
 
+
Again, note that in the examples, the path is displayed as absolute even though it is relative.
+
 
+
 
+
 
+
{{CCBY}}
+
[[Category: Calc Guide (Documentation)]]
+
  
 
== Creating hyperlinks ==
 
== Creating hyperlinks ==
When you type text (such as a website addresses or URL) that can be used as a hyperlink, OOo formats it automatically, creating the hyperlink and applying to the text a color and underlining. If this does not happen, you can enable this feature using '''Tools > AutoCorrect > Options''' and selecting '''URL Recognition'''.
+
When you type text that can be used as a hyperlink (such as a website addresses or URL), Calc formats it automatically, creating the hyperlink and applying to the text a color and background shading. If this does not happen, you can enable this feature using '''Tools > AutoCorrect options > Options''' and selecting '''URL Recognition'''.
  
{{Documentation/Tip| If you do not want OOo to convert a specific URL to a hyperlink, select '''Edit > Undo Insert''' from the menu bar or press ''Control+Z'' immediately after the formatting has been applied.}}
+
{{Tip| To change the color of hyperlinks, go to '''Tools > Options > OpenOffice.org >''' '''Appearance''', scroll to ''Unvisited links'' and/or ''Visited links'', 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.}}
  
{{Documentation/Tip| To change the color of hyperlinks, go to '''Tools > Options > OpenOffice.org >''' '''Appearance''', scroll to ''Unvisited links'' and/or ''Visited links'', 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.}}
+
You can also insert and modify links using the Hyperlink dialog. To display the dialog, click the '''Hyperlink '''icon [[Image:HyperlinkIcon.png]] on the Standard toolbar or choose '''Insert > Hyperlink''' from the menu bar. To turn existing text into a link, highlight it before opening the Hyperlink dialog.  
  
{{Documentation/Tip| 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.}}
+
[[Image:HyperlinkDialog.png|thumb|none|500px|''Hyperlink dialog showing details for Internet links'']]
 
+
You can also insert and modify links using the Hyperlink dialog. To display the dialog, click the '''Hyperlink '''icon [[Image: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.
+
  
 
On the left hand side, select one of the four types of hyperlinks:
 
On the left hand side, select one of the four types of hyperlinks:
  
* '''Internet''': a web address, normally starting with http://
+
* '''Internet''': the hyperlink points to a web address, normally starting with http://
* '''Mail & News''': for example an email address.
+
* '''Mail & News''': the hyperlink opens an email message that is pre-addressed to a particular recipient.
* '''Document''': the hyperlink points to another document or to another place in the presentation.
+
* '''Document''': the hyperlink points to a place in either the current document or another existing document.
 
* '''New document''': the hyperlink creates a new document.
 
* '''New document''': the hyperlink creates a new document.
  
[[Image:HyperlinkDialog.png|thumb|none|500px|''Hyperlink dialog showing details for Internet links'']]
+
The top right part of the dialog changes according to the choice made for the hyperlink category from the left panel. 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.
  
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'' hyperlink, choose the type of hyperlink (choose between Web, FTP or Telnet), and enter the required web address (URL).
  
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'' hyperlink, specify whether it is a mail or news link, the receiver address and for email, also the subject.
  
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'' 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 spreadsheet. Optionally specify the target in the document (for example a specific sheet). 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 ''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 ('''Edit now''') or just create it ('''Edit later''') and enter the file name and the type of document to create (text, spreadsheet, etc.). The '''Select path''' button opens a directory picker dialog.
 
+
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.
 
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.
Line 78: Line 55:
 
: [[Image:CG3Ch9F15.png|thumb|none|500px|''OOo Authors hyperlink as button'']]
 
: [[Image:CG3Ch9F15.png|thumb|none|500px|''OOo Authors hyperlink as button'']]
  
* '''Text''' specifies the text that will be visible to the user.
+
* '''Text''' specifies the text that will be visible to the user. If you do not enter anything here, Calc will use the full URL or path as the link text. Note that if the link is relative and you move the file, this text will not change, though the target will.
 
* '''Name''' is applicable to HTML documents. It specifies text that will be added as a NAME attribute in the HTML code behind the hyperlink.
 
* '''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.
+
* '''Event''' button: this button will be activated to allow Calc to react to events for which the user has written some code (macro). This function is not covered in this chapter.
  
{{Documentation/Note| A hyperlink button is a type of form control. As with all form controls, it can be anchored or positioned by right-clicking on the button in design mode. More information about forms can be found in Chapter 15 of the ''Writer Guide''.
+
{{Note| A hyperlink button is a type of form control. As with all form controls, it can be anchored or positioned by right-clicking on the button in design mode. More information about forms can be found in [[Documentation/OOo3_User_Guides/Writer_Guide/Using_Forms_in_Writer|Using Forms in Writer]].
  
 
For the button to work , the spreadsheet must ''not'' be in design mode. To toggle design mode on and off, view the Form Controls toolbar ('''View > Toolbars > Form Controls''') and click the '''Design Mode On/Off''' button [[Image:FormDesignOffIcon.png]].}}
 
For the button to work , the spreadsheet must ''not'' be in design mode. To toggle design mode on and off, view the Form Controls toolbar ('''View > Toolbars > Form Controls''') and click the '''Design Mode On/Off''' button [[Image:FormDesignOffIcon.png]].}}
  
 
== Editing hyperlinks ==
 
== Editing hyperlinks ==
To edit an existing link, place the cursor anywhere in the link and click '''Edit > Hyperlink'''. The Hyperlink dialog opens. Make your changes and click '''Apply'''. If you need to edit several hyperlinks, you can leave the Hyperlink dialog open until you have edited all of them. Be sure to click '''Apply''' after each one. When you are finished, click '''Close'''.
+
To edit an existing link, place the cursor anywhere in the link and click the hyperlink icon [[Image:HyperlinkIcon.png]] on the standard toolbar or select '''Edit > Hyperlink'''. The Hyperlink dialog opens. If the Hyperlink is in button form, the spreadsheet must have Design
 
+
Mode on in order to edit the Hyperlink. Make your changes and click '''Apply'''. If you need to edit several hyperlinks, you can leave the Hyperlink dialog 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 in OOo 3 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.
+
  
 
== Removing hyperlinks ==
 
== Removing hyperlinks ==
To remove a hyperlink, select it and press the ''Delete'' key. The ''Delete'' dialog opens if it is a text hyperlink.
+
You can remove the clickable link from hyperlink text — leaving just the text — by right-clicking on the link and selecting '''Default Formatting'''. This option is also available from the '''Format''' menu. You may then need to re-apply some formatting in order for it to match the rest of
 +
your document.
 +
 
 +
To erase the link text or button from the document completely, select and press the ''Backspace'' or ''Delete'' key.
 +
[[Category:Documentation]]

Latest revision as of 21:16, 15 July 2018



Hyperlinks can be used in Calc to jump to a different location from within a spreadsheet and can lead to other parts of the current file, to different files or even to web sites.

Relative and absolute hyperlinks

Hyperlinks can be stored within your file as either relative or absolute.

A relative hyperlink says, Here is how to get there from where you are now (meaning the folder in which your current document is saved) while an absolute hyperlink says, Here is how to get there no matter where you start from.

An absolute link will stop working only if the target is moved. A relative link will stop working only if the start and target locations change relative to each other. For instance, if you have two spreadsheets in the same folder linked to each other and you move the entire folder to a new location, a relative hyperlink will not break.

To change the way that OOo saves the hyperlinks in your file, select Tools > Options > Load/Save > General and choose if you want URLs saved relatively when referencing the File System, or the Internet, or both.

Calc will always display an absolute hyperlink. Don’t be alarmed when it does this even when you have chosen a relative hyperlink — this 'absolute' target address will be updated if you move the file..

Documentation note.png Make sure that the folder structure on your computer is the same as the file structure on your web server if you save your links as relative to the file system and you are going to upload pages to the Internet.
Tip.png When you rest the mouse pointer on a hyperlink, a help tip displays the absolute reference, since OOo uses absolute path names internally. The complete path and address can only be seen when you view the result of the HTML export (saving the spreadsheet as an HTML file), by loading the HTML file as Text, or by opening it with a text editor.


Creating hyperlinks

When you type text that can be used as a hyperlink (such as a website addresses or URL), Calc formats it automatically, creating the hyperlink and applying to the text a color and background shading. If this does not happen, you can enable this feature using Tools > AutoCorrect options > Options and selecting URL Recognition.

Tip.png To change the color of hyperlinks, go to Tools > Options > OpenOffice.org > Appearance, scroll to Unvisited links and/or Visited links, 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.


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

Hyperlink dialog showing details for Internet links

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

  • Internet: the hyperlink points to a web address, normally starting with http://
  • Mail & News: the hyperlink opens an email message that is pre-addressed to a particular recipient.
  • Document: the hyperlink points to a place in either the current document or another existing document.
  • New document: the hyperlink creates a new document.

The top right part of the dialog changes according to the choice made for the hyperlink category from the left panel. 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 hyperlink, choose the type of hyperlink (choose between Web, FTP or Telnet), and enter the required web address (URL).

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

For a Document 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 spreadsheet. Optionally specify the target in the document (for example a specific sheet). 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 (Edit now) or just create it (Edit later) and enter the file name and the type of document to create (text, spreadsheet, etc.). The Select path button opens a directory picker dialog.

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. The figure below shows a link formatted as a button.
OOo Authors hyperlink as button
  • Text specifies the text that will be visible to the user. If you do not enter anything here, Calc will use the full URL or path as the link text. Note that if the link is relative and you move the file, this text will not change, though the target will.
  • 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 Calc to react to events for which the user has written some code (macro). This function is not covered in this chapter.
Documentation note.png A hyperlink button is a type of form control. As with all form controls, it can be anchored or positioned by right-clicking on the button in design mode. More information about forms can be found in Using Forms in Writer.

For the button to work , the spreadsheet must not be in design mode. To toggle design mode on and off, view the Form Controls toolbar (View > Toolbars > Form Controls) and click the Design Mode On/Off button FormDesignOffIcon.png.

Editing hyperlinks

To edit an existing link, place the cursor anywhere in the link and click the hyperlink icon HyperlinkIcon.png on the standard toolbar or select Edit > Hyperlink. The Hyperlink dialog opens. If the Hyperlink is in button form, the spreadsheet must have Design Mode on in order to edit the Hyperlink. Make your changes and click Apply. If you need to edit several hyperlinks, you can leave the Hyperlink dialog open until you have edited all of them. Be sure to click Apply after each one. When you are finished, click Close.

Removing hyperlinks

You can remove the clickable link from hyperlink text — leaving just the text — by right-clicking on the link and selecting Default Formatting. This option is also available from the Format menu. You may then need to re-apply some formatting in order for it to match the rest of your document.

To erase the link text or button from the document completely, select and press the Backspace or Delete key.

Personal tools