Cardbox > Forums > Cardbox Talk > "linking to local files"
linking to local files
How do you link to local files |
Current user: [none] |
| Posted By | Post |
|---|---|
noldus | 25-Sep-2007 10:30 Hello i need some help. Is it possible to link to a local file or a file on the server in cardbox like you link to a webpage? Thanks for the Help Dennis |
Mary Doyle (DAF) | 25-Sep-2007 11:28 Dennis We use 2 methods 1. If you use "file://" as the caption for the relevant field you don't have to 2. x = Fields("rf") ' rf is the field containing the path to the file Hope this helps. Mary |
cardboss | 25-Sep-2007 12:38 To find about more about the file: method, open the Cardbox help and search for "file links". (DO type the quotation marks as part of your search request). |
noldus | 25-Sep-2007 13:28 i tried the 1st method which wont work, |
Mary Doyle | 25-Sep-2007 18:00 Hi Dennis, I am afraid you may need to check with Cardbox Support to see why it won't work. I have tested both methods again at home and both work fine for me. I frequently use Cardbox to open files or launch other programs etc on my computer. If you are launching a program with parameters it is a little more complicated but if you need that I can tell you how (not something I worked out for myself, I have to confess - grateful acknowledgement to Martin in Cardbox Support). Re: Method 1 The 2nd method I described also works fine for me i.e. The 2nd method works for me even if there is a space in the filename. For both methods you must have the full path to the file in the relevant field. Maybe someone else can suggest why these methods are not working for you. Mary |
Charles Welling | 26-Sep-2007 08:36 Dennis, if your link does not turn into a clickable one even when everything you typed is correct, then perhaps you haven't installed a recent enough version of Cardbox. Check if you have build 4217 or later. Older builds do not support the use of "file://". If however the link is clickable, and the path\filename is correct, but the file still doesn't open, then check if the file type (look at the extension) has a programme attached to it. Charles |
Paul Irvine | 26-Sep-2007 08:50 Make sure you set the 'Safety level' to Completely Trusted otherwise the file:// prefix is treated as text rather than as a link |
Martin Collis | 10-Dec-2007 11:33 I have exactly the same problem. I have prefaced the field with FILE:// Clicking on it does nothing. We have build 4251. Is the fact the field defining the complete file name+location is indexed rather than just text relevant? As the field is indexed it is already a different colour and does not change when you click on it. Any ideas would be appreciated |
bert | 10-Dec-2007 12:49 Hi, |
cardboss | 10-Dec-2007 23:58 Since you have a support subscription, I suggest that you email us a screenshot so that we can see exactly what you mean. When emailing, it would also help if you could confirm: 1. Whether the cursor changes shape when you move the mouse onto the "file:" prefix [prior to clicking on it]. 2. What safety level the database has been opened with: you can discover this from Window > Properties. This way we won't have to bombard everyone with every step in the process of resolving this problem. Once it has been resolved, we can always post a final message on here so that the solution is available as a reference in the future. Bert, I think that failing to replace a space with "%20" would not lead to nothing happening, but to an error message appearing because the truncated filename ("my", in your example) couldn't be found. Cardbox Support |
R. Woodhouse | 16-Mar-2008 13:53 I have tried these solutions - the first works but the second causes a runtime error 'file not recognised', error character 1 in line 2. I would prefer to use this second method linking the macro to a button, which seem a more elegant solution. I have two further preferences: 1) For my purpose, it would be preferable to use a relative rather than an absolute hypelrink reference so the database is portable between computers. I cannot make this work. 2) It would be nice to link to a bookmark within the specified Word document. This will avoid the need to break up the Word documents into separate files for each reference. Any advice would be much appreciated |
cardboss | 17-Mar-2008 14:23 Robert, Could you let us know what command you are launching? If, instead of x = Fields("rf") ' rf is the field containing the path to the file you say x = Fields("rf") ' rf is the field containing the path to the file what is the message that appears on the screen? (You may be able to copy the message to the clipboard with Ctrl+C). Unlike HTML files, Word files can't (as far as I know) be referred to by names that specify a bookmark name as well as the filename. |
R. Woodhouse | 17-Mar-2008 21:52 The message says "the system cannot find the file specified (80070002). Position in the macro line 2, character 1." The macro is x=fileds("RF") The filename in field RF for the macro is: The filename in another field (which works when clicked) is exactly the same but with "FILE:" in its caption. You can see from the file spec why I want to use relative addressing! Hope this helps diagnsis, |
bert | 17-Mar-2008 23:21 Robert, For launching in macro a file: If there is a space in a path or filename you have to add a quote before the path+filename and after it. If there is no space in path & filename, it will give no problem. So, your macro shoulde be: For testing: If a path & file name works on the windows startmenu option "RUN", it also will work with the launch command in a Cardbox macro (enclosed between quotes). Regards |
R. Woodhouse | 18-Mar-2008 01:44 Dear Bert, Success at last, but I am still a bit confused. The problem turned out to be the location of the quote marks. I placed them around the path/filename in the field RF, and then x=Fields("RF") opened the file corectly, showing the file path in the message box before opening the document. I tried various other combinations of the " locations but could not find another that worked. So, part 1 of the problem is fixed, next is making it work with a relative rather than an absolute reference. Robert |
bert | 18-Mar-2008 08:04 Dear Robert, Then in Word finding a bookmark: It is possible to make a Cardbox macro to open a doc, then finding a bookmark in Word. You have of course to know the name of that bookmark then (place it in a separate field) and of course, the path+file name of the document. Kind regards |
Charles Welling | 18-Mar-2008 10:04 Robert, it is still not quite clear to me exactly why you want to use relative filenames. So far you have given two reasons: the databases must be portable and your pathnames are very long and complicated. But I guess that the real problem is that you have quite a few different folders in which you have stored your documents. Cardbox would have to guess, simply by looking at the file name, where your document is. This can be done if you use structured file names. Suppose you have the following paths: As "My Documents" applies to all files, you can simply make the macro add this at all times. Now let's call the folder Concepts "A" and Final "B". For easy remembering you could even add this to the folder name, e.g. "Concepts (A)", "Final (B)". Alternatively, you can keep using the absolute paths but use GetOpenFilenames to have a macro type it for you. |
R. Woodhouse | 20-Mar-2008 01:06 Thank you Cardboss, Chares, Bert, I now have the relative file names macro working nicely. I have structured the files below the Cardbox Fil/Fmt directory in the sequence of the main divisions and sub-divisions fo the material to be indexed, thus makng the package portable. For Cardboss: I am lacking the knowledge and skills to develop macro further to lead to bookmarks in Word for the final version. I sent a request for advice re assistance and consultants to Support@cardbox this afternoon together with the initial project plan, and hope this has reached you. Thanks to all, |