| View previous topic :: View next topic |
| Author |
Message |
captain caveman General User

Joined: 20 Nov 2007 Posts: 12
|
Posted: Sun Feb 10, 2008 5:26 am Post subject: Linking from a sheet to a scanned image? |
|
|
Hi
Is it possible to have a button that links to a scanned image on the hard drive, for example a value for payment from an invoice would have a button or link that brought up the scanned image of the invoice etc?
Thanks for any help. |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Sun Feb 10, 2008 9:44 am Post subject: |
|
|
=HYPERLINK(A1;B1) shows a hyperlink with text from B1 and a file-url from A1. You may format the cell to look like a hyperlink or button. When I click the hyperlink a picture viewer with the linked picture pops up. This seems to be pre-configured by my Linux distribution.
URL in A1: file:///home/andreas/Documents/Bilder/bdm.jpg
Text in B1 to be displayed with the hyperlink: Landscape |
|
| Back to top |
|
 |
captain caveman General User

Joined: 20 Nov 2007 Posts: 12
|
Posted: Tue Feb 12, 2008 1:08 pm Post subject: |
|
|
Thanks very much Villeroy this is what I was looking for.
 |
|
| Back to top |
|
 |
captain caveman General User

Joined: 20 Nov 2007 Posts: 12
|
Posted: Fri Feb 15, 2008 4:13 pm Post subject: |
|
|
Hi
I am struggling with the file URL box. I can't get it to find the scanned pdf files.
Would it be possible to tell me exactly what to type into a cell to refer to a file if the directory structure was like these two examples......
1.
Calc workbook contained in folder.....
C:\Users\Company\Desktop\Job\
Scanned pdf documents in....
C:\Users\Company\Desktop\Job\Scanned Documents
2.
Calc workbook contained in same folder as scanned documents.
Thanks again for any help. |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Sat Feb 16, 2008 1:13 am Post subject: |
|
|
=MID(CELL("filename");2;SEARCH("/[^/]+'#";CELL("filename"))-1)
returns this document's path.
Last edited by Villeroy on Sat Feb 16, 2008 3:08 am; edited 1 time in total |
|
| Back to top |
|
 |
captain caveman General User

Joined: 20 Nov 2007 Posts: 12
|
Posted: Sat Feb 16, 2008 2:28 am Post subject: |
|
|
Thanks again for taking the time Villeroy, I really do appreciate it.
I don't really want to search for filenames though, it is just a simple manual entry into a workbook for every document that I get in.
I have success with entering the filename like this.....
file:///C:/TenderDocument.pdf
.... which finds the document if I put it in the root directory. Is it possible to make the file reference relative though, because I want to be able to back up whole job folders regularly and still have the links work?
Cheers,  |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Sat Feb 16, 2008 3:08 am Post subject: |
|
|
Create a named reference for ease of use:
Insert>Names>Define...(Ctrl+F3)
Name: Path
Refers To:=MID(CELL("filename");2;SEARCH("/[^/]+'#";CELL("filename"))-1)
[Add], [OK]
Let column A be a list of file names "xxx.pdf" and column B a list of optional descriptions.
Create a hyperlink from this document's path and the file name in A1. Use the label given in B1 or A1 if no label in B1:
=HYPERLINK(Path&A1;IF(B1<>"";B1;A1))
Last edited by Villeroy on Sat Feb 16, 2008 8:18 am; edited 1 time in total |
|
| Back to top |
|
 |
captain caveman General User

Joined: 20 Nov 2007 Posts: 12
|
Posted: Sat Feb 16, 2008 7:33 am Post subject: |
|
|
Yes, that is it!!
Thanks very much for the walkthrough Villeroy, the only thing I cannot do now is get the link to look like a button.
The format character isn't highlighted when the hyperlink cell is selected and the button menu has the control button greyed out. I can't get this either from the manual, do you know what I am missing out?
Danke. |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Sat Feb 16, 2008 7:43 am Post subject: |
|
|
| I have a cell style "hyperlink" with blue, underlined font and another style "button" which makes a cell look like a button (grey background with shadow, bold, centered text). |
|
| Back to top |
|
 |
captain caveman General User

Joined: 20 Nov 2007 Posts: 12
|
Posted: Sat Feb 16, 2008 7:59 am Post subject: |
|
|
I see, so it's not a button graphic, but the format of the cell.
Haben Sie vielen Dank!
 |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
|
| Back to top |
|
 |
brusejames Newbie

Joined: 28 Feb 2008 Posts: 1
|
Posted: Thu Feb 28, 2008 5:19 am Post subject: |
|
|
I have a problem of using hyperlink and relative path to open local file, such as pdf, jpg etc.
Thank Villeroy, but there is a tip to take care, as the red words says.
SEARCH
Returns the position of a text segment within a character string. You can set the start of the search as an option. The search text can be a number or any sequence of characters. The search is not case-sensitive.
The search supports regular expressions. You can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must precede every character with a \ character. You can switch the automatic evaluation of regular expression on and off in Tools - Options - OpenOffice.org Calc - Calculate.
| Villeroy wrote: | Create a named reference for ease of use:
Insert>Names>Define...(Ctrl+F3)
Name: Path
Refers To:=MID(CELL("filename");2;SEARCH("/[^/]+'#";CELL("filename"))-1)
[Add], [OK]
Let column A be a list of file names "xxx.pdf" and column B a list of optional descriptions.
Create a hyperlink from this document's path and the file name in A1. Use the label given in B1 or A1 if no label in B1:
=HYPERLINK(Path&A1;IF(B1<>"";B1;A1)) |
Last edited by brusejames on Thu Feb 28, 2008 5:36 am; edited 1 time in total |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Thu Feb 28, 2008 5:26 am Post subject: |
|
|
| It is a per-document setting, which is turned on by default. When you load an Excel document it is turned off for obvious reasons. |
|
| Back to top |
|
 |
captain caveman General User

Joined: 20 Nov 2007 Posts: 12
|
Posted: Mon Nov 17, 2008 1:40 am Post subject: |
|
|
Hi Villeroy et al, sorry for dragging this one up again, but I'm having a bit of trouble linking to another sheet using the Path name formula.
MID(CELL("filename");2;SEARCH("/[^/]+'#";CELL("filename"))-1)
It works really well when I am linking to scanned images, but I am trying to insert values from another sheet in the same working directory Calc gives an absolute reference to the hard drive, but when I try to replace the C:/Company/Company Accounts/ with Path it doesn't let me.
What is the correct syntax for this so I can have numbers from other sheets using the Path name so that it doesn't break when I move the files?
Thanks for any help. |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
|
| Back to top |
|
 |
|