473,409 Members | 1,945 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,409 software developers and data experts.

Browse to file & save as URL

As a Newbie to VBA, I've just had a successful conclusion to a
protracted struggle with attempts to open a browse window that allows
one to find a file and have that file's path saved in a bound control
that is set as a hyperlink.

I started with the code in http://www.mvps.org/access/api/api0001.htm.

Whilst this dropped the path into the correctly into the control, it
would not work as a hyperlink. But with a bit more ferreting around
the NG, I came across the solution which was to add a prefix to the
path as follows:-

Me.TxtURL = "#file://" & strInputFileName & "#"

This might be useful to some of the other Newbies out there.

Now, being as ambitious as ever, I want to get the browse window to
start at a particular folder on the network. At present it opens at
'My Documents'.

Any ideas how we can get round this?

Yvonne

Jun 21 '07 #1
2 4027
On Thu, 21 Jun 2007 11:43:09 -0700, Dulwich <lo******@yahoo.co.uk>
wrote:

Excellent work so far! I like your attitude.

To get the FileOpen dialog to start at a particular folder, you need
to set the InitialDir field of the OPENFILENAME type. There actually
is an example of that right on that page:
MsgBox "You selected: " & ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Hello! Open Me!")

-Tom.
>As a Newbie to VBA, I've just had a successful conclusion to a
protracted struggle with attempts to open a browse window that allows
one to find a file and have that file's path saved in a bound control
that is set as a hyperlink.

I started with the code in http://www.mvps.org/access/api/api0001.htm.

Whilst this dropped the path into the correctly into the control, it
would not work as a hyperlink. But with a bit more ferreting around
the NG, I came across the solution which was to add a prefix to the
path as follows:-

Me.TxtURL = "#file://" & strInputFileName & "#"

This might be useful to some of the other Newbies out there.

Now, being as ambitious as ever, I want to get the browse window to
start at a particular folder on the network. At present it opens at
'My Documents'.

Any ideas how we can get round this?

Yvonne
Jun 22 '07 #2
On 22 Jun, 02:53, Tom van Stiphout <no.spam.tom7...@cox.netwrote:
On Thu, 21 Jun 2007 11:43:09 -0700, Dulwich <loyal...@yahoo.co.uk>
wrote:

Excellent work so far! I like your attitude.

To get the FileOpen dialog to start at a particular folder, you need
to set the InitialDir field of the OPENFILENAME type. There actually
is an example of that right on that page:
MsgBox "You selected: " & ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Hello! Open Me!")

-Tom.
You rode to the rescue again and got me in the right direction.

I tried modifying the section above with the full path, but that just
took me into the root of C: and no further

I then dabbled at the other potential opportunities and further down
the module I made the folloing change that worked a treat.

Dim fResult As Boolean
' Give the dialog a caption title.
If IsMissing(InitialDir) Then InitialDir = "G:\DFAT\Passports"
If IsMissing(Filter) Then Filter = ""

Many thanks

Yvonne
Jun 22 '07 #3

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

Similar topics

5
by: Rob | last post by:
Help me, I'm just beginning with programming in Access 2000. I've tried the http://www.mvps.org/access/api/api0001.htm but it won't work in Access. What am i doing wrong. I don't have...
0
by: jason | last post by:
some confusion here. The below code allows me to save a local file to my web server and somehow because the field type is file a local file browse button is rendered. I'm trying to figure out...
5
by: Mike Moore | last post by:
I need to create something very similiar to the browse folder capability. This would allow me to support the following - A user would create a document on their server, then they would need to...
3
by: den 2005 | last post by:
Hi everybody, I like to allow user to select and browse to which location to save the pdf file of a crystal report viewed on a web page, how can i do this in ASP.Net? I need to get the path...
4
by: DMG | last post by:
I have <identity impersonate = "true" /& <authentication mode="Windows"/in the web.config. This is a 2.0 site. My Goal: I want to simply have the user browse to a file on a mapped drive and get...
4
by: developing | last post by:
Hi All, I have a browse button that the user can click to select a file. The button then fetches the file path. This is all working fine except my boss wants some add functionality. I need it to...
7
by: ConfusedAlot | last post by:
This is my code for a database, whenever i save the database to the file 'database.txt' and display the results i get this; name - (correct, is what i put in) pin - 3435973836 slew rate -...
1
by: developing | last post by:
Hello, This time I want to filter the 'browse for file' API so that certain drives/folders cant be accessed. Not sure how to go about this...here is the module I am currently using to browse...
3
by: ApexData | last post by:
I am using code from the following links to establish a Browse File and Browse Folder dialog. http://www.mvps.org/access/api/api0001.htm http://www.mvps.org/access/api/api0002.htm This code...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.