PC Review


Reply
Thread Tools Rate Thread

Application.filedialog--- default directory

 
 
=?Utf-8?B?VG9tSGlua2xl?=
Guest
Posts: n/a
 
      22nd Jun 2005
I'm using the application.filedialog method to get a file. I want to set the
default directory where this dialog opens up... any ideas??

(*** I tried
chdrive "C:"
then
chdir "C:\whatever")

didn't seem to work
 
Reply With Quote
 
 
 
 
David Lloyd
Guest
Posts: n/a
 
      22nd Jun 2005
Tom:

One approach is to use the InitialFileName property of the FileDialog object
and set it equal to the directory without specifying an actual filename.
For example:

Dim fd As FileDialog

Set fd = Application.FileDialog(msoFileDialogFilePicker)

fd.InitialFileName = "h:\Program Files"
fd.Show

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


"TomHinkle" <(E-Mail Removed)> wrote in message
news:95E0615E-BB04-4DBA-A72B-(E-Mail Removed)...
I'm using the application.filedialog method to get a file. I want to set
the
default directory where this dialog opens up... any ideas??

(*** I tried
chdrive "C:"
then
chdir "C:\whatever")

didn't seem to work


 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      22nd Jun 2005
Far better is to use APIs. See http://www.mvps.org/access/api/api0001.htm
for a complete example.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"TomHinkle" <(E-Mail Removed)> wrote in message
news:95E0615E-BB04-4DBA-A72B-(E-Mail Removed)...
> I'm using the application.filedialog method to get a file. I want to set
> the
> default directory where this dialog opens up... any ideas??
>
> (*** I tried
> chdrive "C:"
> then
> chdir "C:\whatever")
>
> didn't seem to work



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FileDialog default to Application.CurrentProject.Path hwdperk Microsoft Access VBA Modules 3 27th Jan 2009 07:50 PM
setting the default working directory for a console application spamspasm.nomail@gmail.com Microsoft C# .NET 2 9th Jul 2006 05:15 AM
Takes too long for Filedialog to change directory =?Utf-8?B?RmlsZSBzZWxlY3Rpb24gaW4gb2ZmaWNlMjAwMw== Microsoft Excel Misc 1 1st May 2006 05:33 AM
FileDialog browse button: how do you specify the default directory =?Utf-8?B?cmM1MXd2?= Microsoft Access Form Coding 25 16th Dec 2005 05:46 AM
Application.FileDialog Edward Harford Microsoft Access Form Coding 1 5th Feb 2004 02:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:32 PM.