473,322 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to store folder path as Hyperlink?

I have a subform datasheet which holds hyperlinks to documents stored on
local disk. Each database record has a series of documents associated it.

The link is stored in the table like this:

resource.doc#file:C:\LinkedDocuments\resource.doc#

The problem is when users want to link a folder:

ResourceDocs#C:\LinkedDocuments\ResourceDocs

When users click on this link, Windows Explorer opens the folder, but a
second explorer window is also opened - showing the root C:\ drive. Why the
two explorer windows? Any way around this? I tried a trailing "\" but no
luck.

Thanks in advance.

Dec 26 '05 #1
3 7785
any reason you can't store as regular text and format it as a hyperlink?

Dec 27 '05 #2
Where Me!Document = ResourceDocs#C:\LinkedDocuments\ResourceDocs#, this will
open Windows Explorer properly and display the contents of the ResourceDocs
folder:

strSysRoot = Environ("SystemRoot")
strExplorer = strSysRoot & "\explorer.exe"
strExplorer = strExplorer & " " & HyperlinkPart(Me!Document, acAddress)
Call Shell(strExplorer, vbHide)

Dec 27 '05 #3
Ted
Why use a Hyperlink to open the file? Why not just store the path and
filename and then open the file using the following:
Dim RetVal As Variant
Dim stFile As String
stFile = DLookup("[DataPath]", "tblApplicationInfo") & "CutSheets\"
& Me!FileName
RetVal = fHandleFile(stFile, WIN_NORMAL)

Note that I only store the file name in the field, and use a reference
to where the files are located in a table called tblApplicationInfo
where I store information about the application.
In this example, the file (an Excel file in this application) is stored
in a subfolder of the folder listed in the DataPath field so it is
added to the string in the appropriate location. The Me!FileName refers
to the name of the file on the form.
This code will open any file you tell it to, as long as the
corresponding application is installed on your computer (example: Word
must be installed to open a Word Document, or a paint or image editing
application to open a JPG file, etc.).

Ted

Dec 27 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Aaron | last post by:
My application will only be used on windows based machines. I need to open a folder using UNC naming. i.e. \\server\share\folder I do not need to do anything programatically with the folder...
10
by: Paul Cheetham | last post by:
Hi, I am developing an application that needs to store some machine-specific settings. The application is going to be published on the network in order to keep the clients on the latest version....
7
by: Ibrahim. | last post by:
Hello, How can I access a Shared Folder of the Server by using the following control. 1. I need to download files from c:\resumes folde by using the following; <asp:HyperLink...
0
by: ptkumar | last post by:
Hi All, 1. I have upload files stored in temparary folder with in a context path. when i give hyperlink to the file name, i got error 'File Not Found' if i redeploy the war file then, it will...
4
prabunewindia
by: prabunewindia | last post by:
Hello everybody, here i am going to explain, how to get mails from Outlook express database and store in our own database(local) Initially you have to add the refference Outlook library10.0 or...
5
by: frozenade | last post by:
Hello.. I have two textboxes. one as upload type, and another one as usual textbox. 'cause there's no method to browse folder in html, I want to use the usual textbox to get value about folder...
3
tdw
by: tdw | last post by:
I have a working hyperlink field in a table, and it's form. I also have a working File Picker Dialog: FileDialog(msoFileDialogFilePicker), being used to create the hyperlink. What I need to do, and...
0
by: Brian Vanderburg II | last post by:
Lance Gamet wrote: Lance Gamet wrote: One way I've just started to use it to create a utility function to return the location of the user data folder, depending on the operating system: import...
1
by: mldardy | last post by:
I have a template field in a datagrid. I want to specify a folder path ("file://\\portalweb\frontend\site\reportfiles") in the template field below. Does anyone know how to do that? Here is the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.